SPFormsUserNameSecurityTokenHandler.CreateSecurityToken Method (String, String, String)

Creates a security token that is based on the specified membership provider, user name, and password.

Namespace:  Microsoft.SharePoint.IdentityModel
Assembly:  Microsoft.SharePoint.IdentityModel (in Microsoft.SharePoint.IdentityModel.dll)

Syntax

'Declaration
Public Shared Function CreateSecurityToken ( _
    membershipProviderName As String, _
    username As String, _
    password As String _
) As UserNameSecurityToken
'Usage
Dim membershipProviderName As String
Dim username As String
Dim password As String
Dim returnValue As UserNameSecurityToken

returnValue = SPFormsUserNameSecurityTokenHandler.CreateSecurityToken(membershipProviderName, _
    username, password)
public static UserNameSecurityToken CreateSecurityToken(
    string membershipProviderName,
    string username,
    string password
)

Parameters

  • membershipProviderName
    Type: System.String

    The name of the membership provider that provides password validation logic.

  • username
    Type: System.String

    The name of the user for whom the security token is created.

Return Value

Type: System.IdentityModel.Tokens.UserNameSecurityToken
The security token.

Remarks

This method calls the CreateSecurityToken(String, String, String, String) with null for the role provider name to create a security token for the specified user.

See Also

Reference

SPFormsUserNameSecurityTokenHandler Class

SPFormsUserNameSecurityTokenHandler Members

CreateSecurityToken Overload

Microsoft.SharePoint.IdentityModel Namespace