Early Preview
This is currently very much a preview. Please feel free to try things out,
but don't be upset if anything is not yet working. Feedback is welcome over on our
GitHub Dicussions page.
Microsoft.IdentityModel.Tokens
Includes types that provide support for SecurityTokens, Cryptographic operations: Signing, Verifying Signatures, Encryption.
| Author | Microsoft |
| Version | 8.0.1 |
| Tags | .NET Windows Authentication Identity SecurityTokens Cryptographic operations Signing Verifying Signatures Encryption |
Public Types
Microsoft.​IdentityModel.​Tokens
class AlgorithmValidator
Validates the cryptographic algorithm used.
class AppCompatSwitches
Identifiers used for switching between different app compat behaviors within the Microsoft.IdentityModel libraries.
class AsymmetricSecurityKey
Base class for a <see cref="T:Microsoft.IdentityModel.Tokens.SecurityKey" /> that contains Asymmetric key material.
Provides signature and verification operations for Asymmetric Algorithms using a <see cref="T:Microsoft.IdentityModel.Tokens.SecurityKey" /> .
class AudienceValidator
Validates the audiences found in the security token.
Provides authenticated encryption and decryption services.
Contains the results of <see cref="M:Microsoft.IdentityModel.Tokens.AuthenticatedEncryptionProvider.Encrypt(System.Byte[],System.Byte[])" /> operation.
class Base64UrlEncoder
Encodes and Decodes strings as base64url encoding.
class BaseConfiguration
Represents a generic metadata configuration which is applicable for both XML and JSON based configurations.
class BaseConfigurationManager
Represents a generic configuration manager.
class CallContext
An opaque context used to store work when working with authentication artifacts.
A derived <see cref="T:System.Security.Claims.ClaimsIdentity" /> where claim retrieval is case-sensitive. The current <see cref="T:System.Security.Claims.ClaimsIdentity" /> retrieves claims in a case-insensitive manner which is different than querying the underlying <see cref="P:Microsoft.IdentityModel.Tokens.CaseSensitiveClaimsIdentity.SecurityToken" /> . The <see cref="T:Microsoft.IdentityModel.Tokens.CaseSensitiveClaimsIdentity" /> provides consistent retrieval logic between the <see cref="P:Microsoft.IdentityModel.Tokens.CaseSensitiveClaimsIdentity.SecurityToken" /> and <see cref="T:System.Security.Claims.ClaimsIdentity" /> .
class CompressionAlgorithms
Constants for compression algorithms.
Compression provider factory for compression and decompression.
class CryptoProviderCache
Abstract definition of a cache for cryptographic providers.
Specifies the CryptoProviderCacheOptions which can be used to configure the internal cryptoprovider cache.
We are using our own simple LRU caching implementation across all targets.
See <see cref="T:Microsoft.IdentityModel.Tokens.EventBasedLRUCache`2" /> for more details.
class CryptoProviderFactory
Creates cryptographic operators by specifying a <see cref="T:Microsoft.IdentityModel.Tokens.SecurityKey" /> 's and algorithms.
class DateTimeUtil
Utility class for performing operations involving <see cref="T:System.DateTime" /> and <see cref="T:System.TimeSpan" /> .
A compression provider that supports compression and decompression using the <see cref="F:Microsoft.IdentityModel.Tokens.CompressionAlgorithms.Deflate" /> algorithm.
class EcdhKeyExchangeProvider
Provides a Security Key that can be used as Content Encryption Key (CEK) for use with a JWE
class ECDsaSecurityKey
Represents a ECDsa security key.
class EncryptingCredentials
A class for properties that are used for token encryption.
class EpochTime
Returns the absolute DateTime or the Seconds since Unix Epoch, where Epoch is UTC 1970-01-01T0:0:0Z.
interface ICompressionProvider
Provides methods for compressing and decompressing data.
interface ICryptoProvider
Provides extensibility for cryptographic operators.
If custom operators are needed, <see cref="P:Microsoft.IdentityModel.Tokens.CryptoProviderFactory.CustomCryptoProvider" /> can be set to return these operators.
This property will be checked before each creation.
Defines a cache for crypto providers.
Current support is limited to <see cref="T:Microsoft.IdentityModel.Tokens.SignatureProvider" /> only.
interface ISecurityTokenValidator
ISecurityTokenValidator
class IssuerSigningKeyResolver
Resolves the signing key used for validating a token's signature.
Resolves the signing key using additional configuration.
Validates the signing key used for the security token.
Validates the signing key using additional configuration.
class IssuerValidator
Validates the issuer of the security token.
Validates the issuer using additional configuration.
interface ITokenReplayCache
Interface that defines a simple cache for tacking replaying of security tokens.
Constants for JsonWebAlgorithms "kty" Key Type (sec 6.1)
https://datatracker.ietf.org/doc/html/rfc7518#section-6.1
class JsonWebKey
Represents a JSON Web Key as defined in https://datatracker.ietf.org/doc/html/rfc7517.
class JsonWebKeyConverter
Converts a <see cref="T:Microsoft.IdentityModel.Tokens.SecurityKey" /> into a <see cref="T:Microsoft.IdentityModel.Tokens.JsonWebKey" />
Supports: converting to a <see cref="T:Microsoft.IdentityModel.Tokens.JsonWebKey" /> from one of: <see cref="T:Microsoft.IdentityModel.Tokens.RsaSecurityKey" /> , <see cref="T:Microsoft.IdentityModel.Tokens.X509SecurityKey" /> , and <see cref="T:Microsoft.IdentityModel.Tokens.SymmetricSecurityKey" /> .
class JsonWebKeyECTypes
Constants for JsonWebKey Elliptical Curve Types
https://datatracker.ietf.org/doc/html/rfc7518#section-6.2.1.1
class JsonWebKeyParameterNames
JsonWebKey parameter names
see: https://datatracker.ietf.org/doc/html/rfc7517
class JsonWebKeySet
Contains a collection of <see cref="T:Microsoft.IdentityModel.Tokens.JsonWebKey" /> that can be populated from a json string.
Names for Json Web Key Set Values
class JsonWebKeyUseNames
Constants for JsonWebKeyUse (sec 4.2)
https://datatracker.ietf.org/doc/html/rfc7517#section-4.2
class KeyWrapProvider
Provides Wrap and Unwrap key services.
class LifetimeValidator
Validates the lifetime of the security token.
enum PrivateKeyStatus
Enum for the existence of private key
class RsaKeyWrapProvider
Provides RSA Wrap key and Unwrap key services.
class RsaSecurityKey
Represents a Rsa security key.
class SecurityAlgorithms
Constants for Security Algorithm.
class SecurityKey
Base class for Security Key.
Contains information about the keys inside the tokens.
class SecurityToken
Base class for security token.
Throw this exception when a received <see cref="T:Microsoft.IdentityModel.Tokens.SecurityToken" /> has invalid arguments.
Thrown when JWE compression fails.
Thrown when JWE decompression fails.
Represents a security token exception when decryption failed.
class SecurityTokenDescriptor
Contains some information which used to create a security token.
Represents a security token exception when encryption failed.
This exception is thrown when a security token contained a key identifier but the key was not found by the runtime
when decrypting a token.
class SecurityTokenException
Represents a security token exception.
Throw this exception when a received Security Token has expiration time in the past.
class SecurityTokenHandler
Defines the interface for a Security Token Handler.
This exception is thrown when a cryptographic algorithm is invalid.
This exception is thrown when 'audience' of a token was not valid.
This exception is thrown when 'issuer' of a token was not valid.
This exception is thrown when 'lifetime' of a token was not valid.
This exception is thrown when 'signature' of a token was not valid.
Throw this exception when a received Security Token has an invalid issuer signing key.
This exception is thrown when the token type ('typ' header claim) of a JWT token is invalid.
Represents a key wrap exception when encryption failed.
Represents a <see cref="T:Microsoft.IdentityModel.Tokens.SecurityToken" /> exception when the token is malformed.
This exception is thrown when a security is missing an ExpirationTime.
Throw this exception when a received Security token has an effective time
in the future.
This exception is thrown when an add to the TokenReplayCache fails.
Throw this exception when a received Security Token has been replayed.
This exception is thrown when a security token contained a key identifier but the key was not found by the runtime.
This exception is thrown when a security token contained a key identifier but the key was not found by the runtime
and when validation errors exist over the security token. This exception is not intended to be used as a signal
to refresh keys.
Represents a security token validation exception.
class SignatureProvider
Provides signature services, signing and verifying.
class SignatureValidator
Validates the signature of the security token.
Validates the signature using additional configuration.
class SigningCredentials
Defines the <see cref="T:Microsoft.IdentityModel.Tokens.SecurityKey" /> , algorithm and digest for digital signatures.
class SymmetricKeyWrapProvider
Provides Wrap and Unwrap key services.
class SymmetricSecurityKey
Represents a symmetric security key.
Provides signing and verifying operations using a <see cref="T:Microsoft.IdentityModel.Tokens.SymmetricSecurityKey" /> and specifying an algorithm.
class TokenContext
An opaque context used to store work when working with authentication artifacts.
Resolves the decryption key for the security token.
class TokenHandler
Defines properties shared across all security token handlers.
class TokenReader
Reads the security token.
class TokenReplayValidator
Validates the replay of the security token.
Contains a set of parameters that are used by a <see cref="T:Microsoft.IdentityModel.Tokens.SecurityTokenHandler" /> when validating a <see cref="T:Microsoft.IdentityModel.Tokens.SecurityToken" /> .
class TokenValidationResult
Contains artifacts obtained when a SecurityToken is validated.
A SecurityTokenHandler returns an instance that captures the results of validating a token.
Transforms the security token before signature validation.
class TypeValidator
Validates the type of the security token.
class UniqueId
Generates unique IDs.
class Utility
Contains some utility methods.
enum ValidationFailure
The reason for being unable to validate
class Validators
Partial class for Audience Validation.
An <see cref="T:Microsoft.IdentityModel.Tokens.X509EncryptingCredentials" /> designed to construct <see cref="T:Microsoft.IdentityModel.Tokens.EncryptingCredentials" /> based on a x509 certificate.
class X509SecurityKey
An <see cref="T:Microsoft.IdentityModel.Tokens.AsymmetricSecurityKey" /> that is backed by a <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate2" />
class X509SigningCredentials
Defines the <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate2" /> , algorithm and digest for digital signatures.
Microsoft.​IdentityModel.​Tokens.​Configuration
Defines the options which can be used to configure the internal LKG configuration cache.
See <see cref="T:Microsoft.IdentityModel.Tokens.EventBasedLRUCache`2" /> for more details.