SamlSecurityTokenHandler.ValidateSignature Method

Definition

Validates that the signature, if found is valid.

protected virtual Microsoft.IdentityModel.Tokens.Saml.SamlSecurityToken ValidateSignature (string token, Microsoft.IdentityModel.Tokens.TokenValidationParameters validationParameters);
abstract member ValidateSignature : string * Microsoft.IdentityModel.Tokens.TokenValidationParameters -> Microsoft.IdentityModel.Tokens.Saml.SamlSecurityToken
override this.ValidateSignature : string * Microsoft.IdentityModel.Tokens.TokenValidationParameters -> Microsoft.IdentityModel.Tokens.Saml.SamlSecurityToken
Protected Overridable Function ValidateSignature (token As String, validationParameters As TokenValidationParameters) As SamlSecurityToken

Parameters

token
String

A Saml token.

validationParameters
TokenValidationParameters

TokenValidationParameters that will be used during validation.

Returns

A SamlSecurityToken that has had the signature validated if token was signed.

Exceptions

If validationParameters is null.

If a signature is not found and RequireSignedTokens is true.

If the 'token' has a key identifier and none of the SecurityKey(s) provided result in a validated signature. This can indicate that a key refresh is required.

If after trying all the SecurityKey(s), none result in a validated signture AND the 'token' does not have a key identifier.

Remarks

If the 'token' is signed, the signature is validated even if RequireSignedTokens is false.

If the 'token' signature is validated, then the SigningKey will be set to the key that signed the 'token'. It is the responsibility of SignatureValidator to set the SigningKey

Applies to