JwtSecurityTokenHandler.CanReadToken Method (XmlReader)

Determines if the XmlReader is positioned on a well formed <BinarySecurityToken> element.

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

Syntax

'Declaration
Public Overridable Function CanReadToken ( _
    reader As XmlReader _
) As Boolean
public virtual bool CanReadToken(
    XmlReader reader
)
public:
virtual bool CanReadToken(
    XmlReader^ reader
)
abstract CanReadToken : 
        reader:XmlReader -> bool  
override CanReadToken : 
        reader:XmlReader -> bool
public function CanReadToken(
    reader : XmlReader
) : boolean

Parameters

Return Value

Type: System.Boolean
true if the reader is positioned at an element <BinarySecurityToken> in the namespace http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd.
With an attribute of 'valueType' equal to one of:
"urn:ietf:params:oauth:token-type:jwt", "JWT"
For example: <wsse:BinarySecurityToken valueType = "JWT">
'false' otherwise.

Exceptions

Exception Condition
ArgumentNullException

'reader' is null.

Remarks

The 'EncodingType' attribute is optional, if it is set, it must be equal to: "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary".

.NET Framework Security

See Also

Reference

JwtSecurityTokenHandler Class

CanReadToken Overload

System.IdentityModel.Tokens Namespace