Saml2SecurityTokenHandler.ReadToken Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
ReadToken(String) |
Converts a string into an instance of Saml2SecurityToken. |
ReadToken(XmlReader) |
Reads a Saml2SecurityToken where the XmlReader is positioned the beginning of a Saml2 assertion. |
ReadToken(XmlReader, TokenValidationParameters) |
Reads and validates a SAML 2.0 token using the XmlReader. |
ReadToken(String)
Converts a string into an instance of Saml2SecurityToken.
public override Microsoft.IdentityModel.Tokens.SecurityToken ReadToken (string token);
override this.ReadToken : string -> Microsoft.IdentityModel.Tokens.SecurityToken
Public Overrides Function ReadToken (token As String) As SecurityToken
Parameters
- token
- String
a Saml2 token as a string.
Returns
Exceptions
If token
is null or empty.
If token
.Length is greater than MaximumTokenSizeInBytes.
Applies to
ReadToken(XmlReader)
Reads a Saml2SecurityToken where the XmlReader is positioned the beginning of a Saml2 assertion.
public override Microsoft.IdentityModel.Tokens.SecurityToken ReadToken (System.Xml.XmlReader reader);
override this.ReadToken : System.Xml.XmlReader -> Microsoft.IdentityModel.Tokens.SecurityToken
Public Overrides Function ReadToken (reader As XmlReader) As SecurityToken
Parameters
Returns
Exceptions
If reader
is null.
Applies to
ReadToken(XmlReader, TokenValidationParameters)
Reads and validates a SAML 2.0 token using the XmlReader.
public override Microsoft.IdentityModel.Tokens.SecurityToken ReadToken (System.Xml.XmlReader reader, Microsoft.IdentityModel.Tokens.TokenValidationParameters validationParameters);
override this.ReadToken : System.Xml.XmlReader * Microsoft.IdentityModel.Tokens.TokenValidationParameters -> Microsoft.IdentityModel.Tokens.SecurityToken
Public Overrides Function ReadToken (reader As XmlReader, validationParameters As TokenValidationParameters) As SecurityToken
Parameters
- reader
- XmlReader
A XmlReader reader positioned at a Saml2Assertion element.
- validationParameters
- TokenValidationParameters
The TokenValidationParameters to be used for validating the token.
Returns
An instance of Saml2SecurityToken.
Exceptions
Currently not supported.