JwtSecurityTokenHandler.WriteToken Method (XmlWriter, SecurityToken)
Writes the JwtSecurityToken wrapped in a WS-Security BinarySecurityToken using the XmlWriter.
Namespace: System.IdentityModel.Tokens
Assembly: System.IdentityModel.Tokens.Jwt (in System.IdentityModel.Tokens.Jwt.dll)
Syntax
'Declaration
Public Overridable Sub WriteToken ( _
writer As XmlWriter, _
token As SecurityToken _
)
public virtual void WriteToken(
XmlWriter writer,
SecurityToken token
)
public:
virtual void WriteToken(
XmlWriter^ writer,
SecurityToken^ token
)
abstract WriteToken :
writer:XmlWriter *
token:SecurityToken -> unit
override WriteToken :
writer:XmlWriter *
token:SecurityToken -> unit
public function WriteToken(
writer : XmlWriter,
token : SecurityToken
)
Parameters
- writer
Type: System.Xml.XmlWriter
- token
Type: System.IdentityModel.Tokens.SecurityToken
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | 'writer' is null. -or- 'token' is null. |
ArgumentException | 'token' is not a not JwtSecurityToken. |
Remarks
The JwtSecurityToken current contents are encoded. If SigningCredentials is not null, the encoding will contain a signature.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.