JsonWebTokenHandler.DecryptTokenWithConfigurationAsync 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.
Decrypts a JWE and returns the clear text.
public System.Threading.Tasks.Task<string> DecryptTokenWithConfigurationAsync(Microsoft.IdentityModel.JsonWebTokens.JsonWebToken jwtToken, Microsoft.IdentityModel.Tokens.TokenValidationParameters validationParameters, System.Threading.CancellationToken cancellationToken);
member this.DecryptTokenWithConfigurationAsync : Microsoft.IdentityModel.JsonWebTokens.JsonWebToken * Microsoft.IdentityModel.Tokens.TokenValidationParameters * System.Threading.CancellationToken -> System.Threading.Tasks.Task<string>
Public Function DecryptTokenWithConfigurationAsync (jwtToken As JsonWebToken, validationParameters As TokenValidationParameters, cancellationToken As CancellationToken) As Task(Of String)
Parameters
- jwtToken
- JsonWebToken
The JWE that contains the cypher text.
- validationParameters
- TokenValidationParameters
The TokenValidationParameters to be used for validating the token.
- cancellationToken
- CancellationToken
A CancellationToken that can be used to request cancellation of the asynchronous operation.
Returns
The decoded (clear text) contents of the JWE.
Exceptions
Thrown if validationParameters is null.
Thrown if Enc is null or empty.
Thrown if the decompression failed.
Thrown if Kid is not null AND the decryption fails.
Thrown if the JWE was not able to be decrypted.