Share via


SecurityTokenHandler Class

Definition

Defines the interface for a Security Token Handler.

public abstract class SecurityTokenHandler : Microsoft.IdentityModel.Tokens.TokenHandler, Microsoft.IdentityModel.Tokens.ISecurityTokenValidator
type SecurityTokenHandler = class
    inherit TokenHandler
    interface ISecurityTokenValidator
Public MustInherit Class SecurityTokenHandler
Inherits TokenHandler
Implements ISecurityTokenValidator
Inheritance
SecurityTokenHandler
Derived
Implements

Constructors

SecurityTokenHandler()

Creates an instance of SecurityTokenHandler

Properties

CanValidateToken

Gets a value indicating whether this handler supports validation of tokens handled by this instance.

CanWriteToken

Gets a value indicating whether the class provides serialization functionality to serialize token handled by this instance.

MaximumTokenSizeInBytes

Gets and sets the maximum token size in bytes that will be processed.

(Inherited from TokenHandler)
SetDefaultTimesOnTokenCreation

Gets or sets a bool that controls if token creation will set default 'exp', 'nbf' and 'iat' if not specified.

(Inherited from TokenHandler)
TokenLifetimeInMinutes

Gets or sets the token lifetime in minutes.

(Inherited from TokenHandler)
TokenType

This must be overridden to get the System.Type of the SecurityToken this instance handles.

Methods

CanReadToken(String)

Indicates whether the current token string can be read as a token of the type handled by this instance.

CanReadToken(XmlReader)

Indicates whether the XmlReader is positioned at an element that can be read.

CreateSecurityTokenReference(SecurityToken, Boolean)

Returns SecurityKeyIdentifierClause.

CreateToken(SecurityTokenDescriptor)

Returns SecurityToken.

ReadToken(String)

Converts a string into an instance of SecurityToken.

(Inherited from TokenHandler)
ReadToken(XmlReader, TokenValidationParameters)

This must be overridden to deserialize token with the provided TokenValidationParameters.

ReadToken(XmlReader)

Gets security token.

ValidateToken(String, TokenValidationParameters, SecurityToken)

This must be overridden to validate a token passed as a string using TokenValidationParameters

ValidateToken(XmlReader, TokenValidationParameters, SecurityToken)

Reads and validates a token using a xmlReader and TokenValidationParameters

ValidateTokenAsync(SecurityToken, TokenValidationParameters)

Validates a token. On a validation failure, no exception will be thrown; instead, the exception will be set in the returned TokenValidationResult.Exception property. Callers should always check the TokenValidationResult.IsValid property to verify the validity of the result.

(Inherited from TokenHandler)
ValidateTokenAsync(String, TokenValidationParameters)

Validates a token. On a validation failure, no exception will be thrown; instead, the exception will be set in the returned TokenValidationResult.Exception property. Callers should always check the TokenValidationResult.IsValid property to verify the validity of the result.

(Inherited from TokenHandler)
WriteToken(SecurityToken)

Serializes to string a token of the type handled by this instance.

WriteToken(XmlWriter, SecurityToken)

This must be overridden to serialize to XML a token of the type handled by this instance.

Applies to