SecurityTokenResolver.TryResolveToken Method (SecurityKeyIdentifierClause, SecurityToken)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Attempts to retrieve the security token that matches the specified key identifier clause.

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

public bool TryResolveToken(
	SecurityKeyIdentifierClause keyIdentifierClause,
	out SecurityToken token
)

Parameters

keyIdentifierClause
Type: System.IdentityModel.Tokens.SecurityKeyIdentifierClause

The SecurityKeyIdentifierClause to create a security token for.

token
Type: System.IdentityModel.Tokens.SecurityToken

When this method returns, contains a SecurityToken that represents the specified key identifier clause. This parameter is passed uninitialized.

Return Value

Type: System.Boolean

true when a security token can be retrieved for the specified key identifier clause; otherwise, false.

Exception Condition
ArgumentNullException

keyIdentifierClause is null.

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.

.NET Framework
Available since 3.0
Return to top
Show: