SPSecurityContext.SecurityTokenForFormsAuthentication method (Uri, String, String, String, String)

NOTE: This API is now obsolete.

Obtains a security token for a user authenticating through forms-based authentication.

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

Syntax

'Declaration
<ObsoleteAttribute("Please SecurityTokenForFormsAuthentication(Uri context, String membershipProviderName, String roleProviderName, String username, String password, SPFormsAuthenticationOption options) instead.",  _
    False)> _
Public Shared Function SecurityTokenForFormsAuthentication ( _
    context As Uri, _
    membershipProviderName As String, _
    roleProviderName As String, _
    username As String, _
    password As String _
) As SecurityToken
'Usage
Dim context As Uri
Dim membershipProviderName As String
Dim roleProviderName As String
Dim username As String
Dim password As String
Dim returnValue As SecurityToken

returnValue = SPSecurityContext.SecurityTokenForFormsAuthentication(context, _
    membershipProviderName, roleProviderName, _
    username, password)
[ObsoleteAttribute("Please SecurityTokenForFormsAuthentication(Uri context, String membershipProviderName, String roleProviderName, String username, String password, SPFormsAuthenticationOption options) instead.", 
    false)]
public static SecurityToken SecurityTokenForFormsAuthentication(
    Uri context,
    string membershipProviderName,
    string roleProviderName,
    string username,
    string password
)

Parameters

  • roleProviderName
    Type: System.String

    The name of a RoleProvider registered for the SPWebApplication.

  • username
    Type: System.String

    The user name to be used with the ValidateUser() method.

  • password
    Type: System.String

    The password to be used with MembershipProvider.ValidateUser.

Return value

Type: System.IdentityModel.Tokens.SecurityToken
A security token.

See also

Reference

SPSecurityContext class

SPSecurityContext members

SecurityTokenForFormsAuthentication overload

Microsoft.SharePoint namespace