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.StringThe name of the membership provider that provides password validation logic.
username
Type: System.StringThe name of the user for whom the security token is created.
password
Type: System.StringThe password for the user.
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