SessionSecurityTokenHandler.ReadToken SessionSecurityTokenHandler.ReadToken SessionSecurityTokenHandler.ReadToken SessionSecurityTokenHandler.ReadToken Method

Definition

Overloads

ReadToken(XmlReader) ReadToken(XmlReader) ReadToken(XmlReader) ReadToken(XmlReader)

Reads the SessionSecurityToken using the specified XML reader.

ReadToken(Byte[], SecurityTokenResolver) ReadToken(Byte[], SecurityTokenResolver) ReadToken(Byte[], SecurityTokenResolver) ReadToken(Byte[], SecurityTokenResolver)

Reads the SessionSecurityToken from a stream of bytes by using the specified token resolver.

ReadToken(XmlReader, SecurityTokenResolver) ReadToken(XmlReader, SecurityTokenResolver) ReadToken(XmlReader, SecurityTokenResolver) ReadToken(XmlReader, SecurityTokenResolver)

Reads the SessionSecurityToken using the specified XML reader and token resolver.

Remarks

Important

Calling this method with untrusted data is a security risk. Call this method only with trusted data. For more information, see Data Validation.

The default implementation deserializes the token from either a WS-Secure Conversation Feb2005 or WS-Secure Conversation 1.3 <wsc:SecurityContextToken> element.

ReadToken(XmlReader) ReadToken(XmlReader) ReadToken(XmlReader) ReadToken(XmlReader)

Reads the SessionSecurityToken using the specified XML reader.

public:
 override System::IdentityModel::Tokens::SecurityToken ^ ReadToken(System::Xml::XmlReader ^ reader);
public override System.IdentityModel.Tokens.SecurityToken ReadToken (System.Xml.XmlReader reader);
override this.ReadToken : System.Xml.XmlReader -> System.IdentityModel.Tokens.SecurityToken
Public Overrides Function ReadToken (reader As XmlReader) As SecurityToken

Parameters

Returns

The session security token that was read, an instance of SessionSecurityToken.

Exceptions

Remarks

Important

Calling this method with untrusted data is a security risk. Call this method only with trusted data. For more information, see Data Validation.

The reader must be positioned at either a WS-Secure Conversation Feb2005 or a WS-Secure Conversation 1.3 <wsc:SecurityContextToken> element.

The default implementation invokes the SessionSecurityTokenHandler.ReadToken(XmlReader, SecurityTokenResolver) method using a default token resolver.

ReadToken(Byte[], SecurityTokenResolver) ReadToken(Byte[], SecurityTokenResolver) ReadToken(Byte[], SecurityTokenResolver) ReadToken(Byte[], SecurityTokenResolver)

Reads the SessionSecurityToken from a stream of bytes by using the specified token resolver.

public:
 virtual System::IdentityModel::Tokens::SecurityToken ^ ReadToken(cli::array <System::Byte> ^ token, System::IdentityModel::Selectors::SecurityTokenResolver ^ tokenResolver);
public virtual System.IdentityModel.Tokens.SecurityToken ReadToken (byte[] token, System.IdentityModel.Selectors.SecurityTokenResolver tokenResolver);
override this.ReadToken : byte[] * System.IdentityModel.Selectors.SecurityTokenResolver -> System.IdentityModel.Tokens.SecurityToken
Public Overridable Function ReadToken (token As Byte(), tokenResolver As SecurityTokenResolver) As SecurityToken

Parameters

token
Byte[]

The stream of bytes that contains the token.

Returns

Remarks

Important

Calling this method with untrusted data is a security risk. Call this method only with trusted data. For more information, see Data Validation.

The default implementation creates an XmlDictionaryReader over the token and invokes the SessionSecurityTokenHandler.ReadToken(XmlReader, SecurityTokenResolver) method.

ReadToken(XmlReader, SecurityTokenResolver) ReadToken(XmlReader, SecurityTokenResolver) ReadToken(XmlReader, SecurityTokenResolver) ReadToken(XmlReader, SecurityTokenResolver)

Reads the SessionSecurityToken using the specified XML reader and token resolver.

public:
 override System::IdentityModel::Tokens::SecurityToken ^ ReadToken(System::Xml::XmlReader ^ reader, System::IdentityModel::Selectors::SecurityTokenResolver ^ tokenResolver);
public override System.IdentityModel.Tokens.SecurityToken ReadToken (System.Xml.XmlReader reader, System.IdentityModel.Selectors.SecurityTokenResolver tokenResolver);
override this.ReadToken : System.Xml.XmlReader * System.IdentityModel.Selectors.SecurityTokenResolver -> System.IdentityModel.Tokens.SecurityToken
Public Overrides Function ReadToken (reader As XmlReader, tokenResolver As SecurityTokenResolver) As SecurityToken

Parameters

Returns

The session security token that was read, an instance of SessionSecurityToken.

Exceptions

Remarks

Important

Calling this method with untrusted data is a security risk. Call this method only with trusted data. For more information, see Data Validation.

The reader must be positioned at either a WS-Secure Conversation Feb2005 or a WS-Secure Conversation 1.3 <wsc:SecurityContextToken> element.

If the token material is cached, it is read from the token cache, which is an instance of the SessionSecurityTokenCache class. Otherwise, the token material is read from the child element of the <wsc:SecurityContextToken> element that is specified by the CookieElementName and CookieNamespace properties and the ApplyTransforms method is invoked to decode the cookie.

For more information about how session tokens are serialized into a <SecurityContextToken element, see the SessionSecurityTokenHandler.WriteToken(XmlWriter, SecurityToken) method.

Applies to