请注意:此 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
)
参数
context
类型:System.Uri指向SPWebApplication对象上下文 URL。
membershipProviderName
类型:System.String为SPWebApplication注册MembershipProvider的名称。
roleProviderName
类型:System.String为SPWebApplication注册RoleProvider的名称。
username
类型:System.String要与**ValidateUser()**方法一起使用的用户名。
password
类型:System.String要与MembershipProvider.ValidateUser一起使用的密码。
返回值
类型:System.IdentityModel.Tokens.SecurityToken
安全令牌。