UNPKG

@trimble-oss/trimble-id

Version:

Trimble Identity SDK for JavaScript/ TypeScript

34 lines (33 loc) 1.67 kB
import {Claimset} from "./Claimset" import { IClaimsetProvider } from './IClaimsetProvider'; import { IKeysetProvider } from './IKeysetProvider'; /** * @implements {IClaimsetProvider} * @description ValidatedClaimsetProvider provides a validated claimset for a JSON web token. */ declare class ValidatedClaimsetProvider implements IClaimsetProvider { /** * @description Public constructor for ValidatedClaimsetProvider class * @param {IKeysetProvider} keysetProvider A provider for the keyset used to validate the JWT claimset. * It can be OpenIdKeysetProvider/FixedKeysetProvider */ constructor(keysetProvider: IKeysetProvider); /** * @description Fluent extension for setting clock skew/grace period while validating the token. * @param {number} clockSkewInSeconds is the acceptable time difference between signer and verifier in seconds. */ WithClockSkew(clockSkewInSeconds: number): this; /** * @description Fluent extension for allowing token validation. * @param {boolean} tokenValidationRequired is set to false if token validation is not required for retrieving claims. */ WithTokenValidation(tokenValidationRequired: boolean): this; /** * @description Retrieves a validated claimset from a given JSON web token * @returns {PromiseLike<Claimset>} A Task that resolves to the claimset completion * @exception Thrown when the keyset provider does not provide the named key * @exception Thrown when the JSON web token is invalid */ RetrieveClaimset(token: string): Promise<Claimset>; } export default ValidatedClaimsetProvider