Edit

Share via


SecurityTokenResolver.ResolveToken Method

Definition

Retrieves a security token that matches the specified key identifier.

Overloads

ResolveToken(SecurityKeyIdentifier)

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

ResolveToken(SecurityKeyIdentifierClause)

Retrieves the security token that matches the specified key identifier clause.

ResolveToken(SecurityKeyIdentifier)

Source:
SecurityTokenResolver.cs
Source:
SecurityTokenResolver.cs

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

public:
 System::IdentityModel::Tokens::SecurityToken ^ ResolveToken(System::IdentityModel::Tokens::SecurityKeyIdentifier ^ keyIdentifier);
public System.IdentityModel.Tokens.SecurityToken ResolveToken (System.IdentityModel.Tokens.SecurityKeyIdentifier keyIdentifier);
member this.ResolveToken : System.IdentityModel.Tokens.SecurityKeyIdentifier -> System.IdentityModel.Tokens.SecurityToken
Public Function ResolveToken (keyIdentifier As SecurityKeyIdentifier) As SecurityToken

Parameters

keyIdentifier
SecurityKeyIdentifier

The SecurityKeyIdentifier to create a security token for.

Returns

A SecurityToken that represents the specified key identifier.

Exceptions

keyIdentifier is null.

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

Remarks

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.

Applies to

ResolveToken(SecurityKeyIdentifierClause)

Source:
SecurityTokenResolver.cs
Source:
SecurityTokenResolver.cs

Retrieves the security token that matches the specified key identifier clause.

public:
 System::IdentityModel::Tokens::SecurityToken ^ ResolveToken(System::IdentityModel::Tokens::SecurityKeyIdentifierClause ^ keyIdentifierClause);
public System.IdentityModel.Tokens.SecurityToken ResolveToken (System.IdentityModel.Tokens.SecurityKeyIdentifierClause keyIdentifierClause);
member this.ResolveToken : System.IdentityModel.Tokens.SecurityKeyIdentifierClause -> System.IdentityModel.Tokens.SecurityToken
Public Function ResolveToken (keyIdentifierClause As SecurityKeyIdentifierClause) As SecurityToken

Parameters

keyIdentifierClause
SecurityKeyIdentifierClause

The SecurityKeyIdentifierClause to create a security token for.

Returns

A SecurityToken that represents the specified key identifier clause.

Remarks

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

Applies to