Zum Hauptinhalt springen

AccessTokenInspector

Namespace: Meshmakers.Octo.Sdk.ServiceClient.Authentication

Reads claims of an access token without validating it. The service that receives the token validates signature, issuer and lifetime; the client only needs to know which tenant a token was issued for before it decides whether the token may be sent to a tenant's routes.

public static class AccessTokenInspector

Inheritance Object → AccessTokenInspector

Fields​

TenantIdClaimType​

Name of the claim that carries the tenant a token was issued for.

public static string TenantIdClaimType;

Methods​

TryGetTenantId(String)​

Returns the tenant_id claim of a JWT access token, or null when the token is blank, not a JWT or carries no such claim.

public static string TryGetTenantId(string accessToken)

Parameters​

accessToken String
The access token.

Returns​

String

IsIssuedForOtherTenant(String, String)​

True when accessToken is known to be issued for another tenant than tenantId. A token whose tenant cannot be determined is not a mismatch.

public static bool IsIssuedForOtherTenant(string accessToken, string tenantId)

Parameters​

accessToken String

tenantId String

Returns​

Boolean

Fingerprint(String)​

internal static string Fingerprint(string value)

Parameters​

value String

Returns​

String