SecurityTokenResolver.ResolveToken Method (SecurityKeyIdentifier)


Retrieves a security token that matches one of the security key identifier clauses contained within the specified key identifier.

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

public SecurityToken ResolveToken(
	SecurityKeyIdentifier keyIdentifier


Type: System.IdentityModel.Tokens.SecurityKeyIdentifier

The SecurityKeyIdentifier to create a security token for.

Return Value

Type: System.IdentityModel.Tokens.SecurityToken

A SecurityToken that represents the specified key identifier.

Exception Condition

keyIdentifier is null.


A security token cannot be created for the specified key identifier.

The TryResolveToken and ResolveToken methods differ in what happens when the key identifier cannot be resolved to a security token. The TryResolveToken method returns false, whereas the ResolveToken method throws an exception.

.NET Framework
Available since 3.0
Return to top