Export (0) Print
Expand All

SessionSecurityTokenHandler.ValidateToken Method (SessionSecurityToken, String)

.NET Framework 4.5

Validates the specified session token and returns its claims.

Namespace:  System.IdentityModel.Tokens
Assembly:  System.IdentityModel (in System.IdentityModel.dll)

public virtual ReadOnlyCollection<ClaimsIdentity> ValidateToken(
	SessionSecurityToken token,
	string endpointId
)

Parameters

token
Type: System.IdentityModel.Tokens.SessionSecurityToken

The token to be validated. Must be assignable from SessionSecurityToken.

endpointId
Type: System.String

The identifier of the endpoint to which the token is scoped.

Return Value

Type: System.Collections.ObjectModel.ReadOnlyCollection<ClaimsIdentity>
The identities that are contained in the token.

ExceptionCondition
ArgumentNullException

token is null.

-or-

endpointId is null.

InvalidOperationException

token is not assignable from SessionSecurityToken.

SecurityTokenException

The EndpointId property of the specified token is not null or empty and its value is different than that specified by the endpointId parameter.

Performs a check to make sure that the specified token is scoped for the specified endpoint ID and, if so, invokes the SessionSecurityTokenHandler.ValidateToken(SecurityToken) method; otherwise, throws a SecurityTokenException.

Security noteSecurity Note

Session tokens that have an EndpointId property that is null or empty are considered to be globally scoped. This presents a potential security risk. For this reason you should make sure that the EndpointId property is set in your session tokens.

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft