Share via


JwtSecurityTokenRequirement Constructor (XmlElement)

Provides additional configuration to the JwtSecurityTokenHandler when validating or creating a JwtSecurityToken.

Namespace:  System.IdentityModel.Tokens
Assembly:  System.IdentityModel.Tokens.Jwt (in System.IdentityModel.Tokens.Jwt.dll)

Syntax

'Declaration
Public Sub New ( _
    element As XmlElement _
)
public JwtSecurityTokenRequirement(
    XmlElement element
)
public:
JwtSecurityTokenRequirement(
    XmlElement^ element
)
new : 
        element:XmlElement -> JwtSecurityTokenRequirement
public function JwtSecurityTokenRequirement(
    element : XmlElement
)

Parameters

Exceptions

Exception Condition
ArgumentNullException

'element' is null.

ConfigurationErrorsException

LocalName is not 'jwtSecurityTokenRequirement'.

-or-

if a LocalName is not expected.

-or-

a Value of <jwtSecurityTokenRequirement> is null or whitespace.

-or-

a Value is not expected.

-or-

if the LocalName of a child element of <jwtSecurityTokenRequirement> is not expected.

-or-

if a child element of <jwtSecurityTokenRequirement> is not well formed.

-or-

if the 'issuerCertificateValidationMode' == 'Custom' and a 'issuerCertificateValidator' attribute was not specified.

-or-

if the runtime was not able to create the type specified by a the 'issuerCertificateValidator' attribute.

-or-

if a child element of <jwtSecurityTokenRequirement> is not well formed.

Remarks

A single XML element is expected with up to four optional attributes: {'expected values'} and up to five optional child elements.

<jwtSecurityTokenRequirement

issuerCertificateRevocationMode: {NoCheck, OnLine, OffLine}

issuerCertificateTrustedStoreLocation: {CurrentUser, LocalMachine}

issuerCertificateValidator: type derived from X509CertificateValidator

issuerCertificateValidationMode: {ChainTrust, Custom, None, PeerTrust, PeerOrChainTrust}

>

<nameClaimType value = 'somestring'/>

<roleClaimType value = 'somestring'/>

<defaultTokenLifetimeInMinutes value = 'UInt32'/>

<maxTokenSizeInBytes value = 'UInt32'/>

<maxClockSkewInMinutes value = 'UInt32'/>

</jwtSecurityTokenRequirement>

.NET Framework Security

See Also

Reference

JwtSecurityTokenRequirement Class

JwtSecurityTokenRequirement Overload

System.IdentityModel.Tokens Namespace