Skip to content

Commit

Permalink
Merge pull request IdentityModel#1271 from coolhome/clock-service-types
Browse files Browse the repository at this point in the history
Add types for ClockService
  • Loading branch information
brockallen authored Dec 20, 2020
2 parents 7a68720 + fea66d1 commit 2c3eee6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,15 @@ export interface OidcClientSettings {
readonly staleStateAge?: number;
/** The window of time (in seconds) to allow the current time to deviate when validating id_token's iat, nbf, and exp values (default: 300) */
readonly clockSkew?: number;
readonly clockService?: ClockService;
readonly stateStore?: StateStore;
readonly userInfoJwtIssuer?: 'ANY' | 'OP' | string;
ResponseValidatorCtor?: ResponseValidatorCtor;
MetadataServiceCtor?: MetadataServiceCtor;
/** An object containing additional query string parameters to be including in the authorization request */
extraQueryParams?: Record<string, any>;

getEpochTime(): Promise<number>;
}

export class UserManager extends OidcClient {
Expand Down Expand Up @@ -305,6 +308,10 @@ export interface UserManagerSettings extends OidcClientSettings {
readonly userStore?: WebStorageStateStore;
}

export interface ClockService {
getEpochTime(): Promise<number>;
}

export interface WebStorageStateStoreSettings {
prefix?: string;
store?: any;
Expand Down

0 comments on commit 2c3eee6

Please sign in to comment.