SecurityTokenResolver.TryResolveToken Método

Definição

Tenta recuperar o token de segurança referenciado no objeto especificado.

Sobrecargas

Name Description
TryResolveToken(SecurityKeyIdentifier, SecurityToken)

Tenta recuperar o token de segurança que corresponde a uma das cláusulas de identificador de chave contidas no identificador de chave especificado.

TryResolveToken(SecurityKeyIdentifierClause, SecurityToken)

Tenta recuperar o token de segurança que corresponde à cláusula identificadora de chave especificada.

TryResolveToken(SecurityKeyIdentifier, SecurityToken)

Tenta recuperar o token de segurança que corresponde a uma das cláusulas de identificador de chave contidas no identificador de chave especificado.

public:
 bool TryResolveToken(System::IdentityModel::Tokens::SecurityKeyIdentifier ^ keyIdentifier, [Runtime::InteropServices::Out] System::IdentityModel::Tokens::SecurityToken ^ % token);
public bool TryResolveToken(System.IdentityModel.Tokens.SecurityKeyIdentifier keyIdentifier, out System.IdentityModel.Tokens.SecurityToken token);
member this.TryResolveToken : System.IdentityModel.Tokens.SecurityKeyIdentifier * SecurityToken -> bool
Public Function TryResolveToken (keyIdentifier As SecurityKeyIdentifier, ByRef token As SecurityToken) As Boolean

Parâmetros

keyIdentifier
SecurityKeyIdentifier

O SecurityKeyIdentifier para criar um token de segurança para.

token
SecurityToken

Quando este método retorna, contém um SecurityToken que representa o identificador de chave especificado. Este parâmetro é passado sem inicializar.

Devoluções

true quando um token de segurança pode ser recuperado para o identificador de chave especificado; caso contrário, false.

Exceções

keyIdentifier é null.

Observações

Os TryResolveToken métodos e ResolveToken diferem no que acontece quando o identificador de chave não pode ser resolvido para um token de segurança. O TryResolveToken método devolve false, enquanto o ResolveToken método lança uma exceção.

Aplica-se a

TryResolveToken(SecurityKeyIdentifierClause, SecurityToken)

Tenta recuperar o token de segurança que corresponde à cláusula identificadora de chave especificada.

public:
 bool TryResolveToken(System::IdentityModel::Tokens::SecurityKeyIdentifierClause ^ keyIdentifierClause, [Runtime::InteropServices::Out] System::IdentityModel::Tokens::SecurityToken ^ % token);
public bool TryResolveToken(System.IdentityModel.Tokens.SecurityKeyIdentifierClause keyIdentifierClause, out System.IdentityModel.Tokens.SecurityToken token);
member this.TryResolveToken : System.IdentityModel.Tokens.SecurityKeyIdentifierClause * SecurityToken -> bool
Public Function TryResolveToken (keyIdentifierClause As SecurityKeyIdentifierClause, ByRef token As SecurityToken) As Boolean

Parâmetros

keyIdentifierClause
SecurityKeyIdentifierClause

O SecurityKeyIdentifierClause para criar um token de segurança para.

token
SecurityToken

Quando este método retorna, contém um SecurityToken que representa a cláusula identificadora de chave especificada. Este parâmetro é passado sem inicializar.

Devoluções

true quando um token de segurança pode ser recuperado para a cláusula de identificador de chave especificada; caso contrário, false.

Exceções

keyIdentifierClause é null.

Observações

Os TryResolveToken métodos e ResolveToken diferem no que acontece quando a cláusula de identificador de chave não pode ser resolvida para um token de segurança. O TryResolveToken método devolve false, enquanto o ResolveToken método lança uma exceção.

Aplica-se a