Saml2SecurityTokenHandler.CreateAuthenticationStatement Method

Definition

Creates a SAML 2.0 authentication statement from the specified authentication information.

C#
protected virtual System.IdentityModel.Tokens.Saml2AuthenticationStatement CreateAuthenticationStatement(System.Security.Claims.AuthenticationInformation authInfo, System.IdentityModel.Tokens.SecurityTokenDescriptor tokenDescriptor);

Parameters

authInfo
AuthenticationInformation

An AuthenticationInformation object that contains the state to be wrapped as a Saml2AuthenticationStatement object.

tokenDescriptor
SecurityTokenDescriptor

The token descriptor.

Returns

A Saml2AuthenticationStatement to add to the assertion being created or null to ignore the AuthenticationInformation object (and not create a SAML 2.0 authentication statement).

Exceptions

tokenDescriptor is null.

-or-

The Subject property of tokenDescriptor is null.

The subject of the tokenDescriptor (the Subject property) contains claims with a claim type of either AuthenticationInstant or AuthenticationMethod but does not contain at least one claim of each type.

-or-

The authentication method specified by the subject of the tokenDescriptor cannot be resolved to an absolute URI.

Applies to

Produkt Versiounen
.NET Framework 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1