Class JsonWebSignature
JSON Web Signature (JWS) implementation as specified in http://tools.ietf.org/html/draft-ietf-jose-json-web-signature-11.
Inherited Members
Namespace: Google.Apis.Auth
Assembly: Google.Apis.Auth.dll
Syntax
public class JsonWebSignature
Methods
VerifySignedTokenAsync(string, SignedTokenVerificationOptions, CancellationToken)
Verifies that the given token is a valid, not expired, signed token.
Declaration
public static Task<JsonWebSignature.Payload> VerifySignedTokenAsync(string signedJwt, SignedTokenVerificationOptions options = null, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | signedJwt | The token to verify. |
SignedTokenVerificationOptions | options | The options to use for verification. May be null in which case default options will be used. |
CancellationToken | cancellationToken | The cancellation token for the operation. |
Returns
Type | Description |
---|---|
Task<JsonWebSignature.Payload> | The payload contained by the token. |
Exceptions
Type | Condition |
---|---|
InvalidJwtException | If the token is invalid or expired. |
VerifySignedTokenAsync<TPayload>(string, SignedTokenVerificationOptions, CancellationToken)
Verifies that the given token is a valid, not expired, signed token.
Declaration
public static Task<TPayload> VerifySignedTokenAsync<TPayload>(string signedJwt, SignedTokenVerificationOptions options = null, CancellationToken cancellationToken = default) where TPayload : JsonWebSignature.Payload
Parameters
Type | Name | Description |
---|---|---|
string | signedJwt | The token to verify. |
SignedTokenVerificationOptions | options | The options to use for verification. May be null in which case default options will be used. |
CancellationToken | cancellationToken | The cancellation token for the operation. |
Returns
Type | Description |
---|---|
Task<TPayload> | The payload contained by the token. |
Type Parameters
Name | Description |
---|---|
TPayload | The type of the payload to return, so user code can validate additional claims. Should extend JsonWebSignature.Payload. Payload information will be deserialized using Google.Apis.Json.NewtonsoftJsonSerializer.Instance. |
Exceptions
Type | Condition |
---|---|
InvalidJwtException | If the token is invalid or expired. |