SPFormsUserNameSecurityTokenHandler.ValidateToken Method (SecurityToken)

Validates the specified security token and returns a set of claims-based identity values for the user associated with the specified security token.

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

Syntax

'Declaration
Public Overridable Function ValidateToken ( _
    token As SecurityToken _
) As ClaimsIdentityCollection
'Usage
Dim instance As SPFormsUserNameSecurityTokenHandler
Dim token As SecurityToken
Dim returnValue As ClaimsIdentityCollection

returnValue = instance.ValidateToken(token)
public virtual ClaimsIdentityCollection ValidateToken(
    SecurityToken token
)

Parameters

Return Value

Type: ClaimsIdentityCollection
A set of claims-based identity values for the user associated with the specified security token.

Exceptions

Exception Condition
ArgumentNullException

The token is null .

ArgumentException

The token is not a UserNameSecurityToken.

Remarks

This override validates the user name and password associated with the specified security token based on the cached token, if it exists. If the cached token does not exist, this override calls the membership provider associated with the security token to validate the user. If the user name and password are valid, this override returns a set of claims-based identity values based on Forms authentication, including the user name and all roles associated with the user name; otherwise, this override throws an exception.

See Also

Reference

SPFormsUserNameSecurityTokenHandler Class

SPFormsUserNameSecurityTokenHandler Members

ValidateToken Overload

Microsoft.SharePoint.IdentityModel Namespace