SPSecurityContext.SecurityTokenForFormsAuthentication 方法 (Uri, String, String, String, String)

请注意:此 API 现在已过时。

获取用于通过基于表单的身份验证进行身份验证的用户安全令牌。

命名空间:  Microsoft.SharePoint
程序集:  Microsoft.SharePoint(位于 Microsoft.SharePoint.dll 中)

语法

声明
<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
用法
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
)

参数

  • roleProviderName
    类型:System.String

    为SPWebApplication注册RoleProvider的名称。

  • username
    类型:System.String

    要与**ValidateUser()**方法一起使用的用户名。

  • password
    类型:System.String

    要与MembershipProvider.ValidateUser一起使用的密码。

返回值

类型:System.IdentityModel.Tokens.SecurityToken
安全令牌。

另请参阅

引用

SPSecurityContext 类

SPSecurityContext 成员

SecurityTokenForFormsAuthentication 重载

Microsoft.SharePoint 命名空间