X509SecurityTokenHandler.ValidateToken(SecurityToken) Method

Definition

Validates the specified X.509 security token.

public:
 override System::Collections::ObjectModel::ReadOnlyCollection<System::Security::Claims::ClaimsIdentity ^> ^ ValidateToken(System::IdentityModel::Tokens::SecurityToken ^ token);
public override System.Collections.ObjectModel.ReadOnlyCollection<System.Security.Claims.ClaimsIdentity> ValidateToken (System.IdentityModel.Tokens.SecurityToken token);
override this.ValidateToken : System.IdentityModel.Tokens.SecurityToken -> System.Collections.ObjectModel.ReadOnlyCollection<System.Security.Claims.ClaimsIdentity>
Public Overrides Function ValidateToken (token As SecurityToken) As ReadOnlyCollection(Of ClaimsIdentity)

Parameters

token
SecurityToken

The token to be validated.

Returns

The identities contained in the token.

Exceptions

token is not assignable from X509SecurityToken.

token is null.

The Configuration property is null.

-or-

There is no issuer name registry (IssuerNameRegistry) configured. (The IssuerNameRegistry property of the SecurityTokenHandlerConfiguration referenced by the Configuration property is null.)

The current X509CertificateValidator was unable to validate the certificate in the token.

The current IssuerNameRegistry returned null when trying to resolve the issuer of the certificate in the token.

Applies to