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
context
Type: System.UriA context URL that points to an SPWebApplication object.
membershipProviderName
Type: System.StringThe name of a MembershipProvider registered for the SPWebApplication.
roleProviderName
Type: System.StringThe name of a RoleProvider registered for the SPWebApplication.
username
Type: System.StringThe user name to be used with the ValidateUser() method.
password
Type: System.StringThe password to be used with MembershipProvider.ValidateUser.
Return value
Type: System.IdentityModel.Tokens.SecurityToken
A security token.