@@ -57,9 +57,11 @@ export class Log {
5757}
5858
5959export interface MetadataService {
60- new ( settings : OidcClientSettings ) : MetadataService ;
60+ new ( settings : OidcClientSettings ) : MetadataService ;
6161
6262 metadataUrl ?: string ;
63+
64+ resetSigningKeys ( ) : void ;
6365
6466 getMetadata ( ) : Promise < OidcMetadata > ;
6567
@@ -69,7 +71,7 @@ export interface MetadataService {
6971
7072 getUserInfoEndpoint ( ) : Promise < string > ;
7173
72- getTokenEndpoint ( ) : Promise < string | undefined > ;
74+ getTokenEndpoint ( optional : boolean = true ) : Promise < string | undefined > ;
7375
7476 getCheckSessionIframe ( ) : Promise < string | undefined > ;
7577
@@ -156,12 +158,16 @@ export interface OidcClientSettings {
156158 readonly staleStateAge ?: number ;
157159 /** 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) */
158160 readonly clockSkew ?: number ;
161+ readonly clockService ?: ClockService ;
159162 readonly stateStore ?: StateStore ;
160163 readonly userInfoJwtIssuer ?: 'ANY' | 'OP' | string ;
164+ readonly mergeClaims ?: boolean ;
161165 ResponseValidatorCtor ?: ResponseValidatorCtor ;
162166 MetadataServiceCtor ?: MetadataServiceCtor ;
163167 /** An object containing additional query string parameters to be including in the authorization request */
164168 extraQueryParams ?: Record < string , any > ;
169+
170+ getEpochTime ( ) : Promise < number > ;
165171}
166172
167173export class UserManager extends OidcClient {
@@ -248,6 +254,10 @@ export interface UserManagerEvents extends AccessTokenEvents {
248254 addSilentRenewError ( callback : UserManagerEvents . SilentRenewErrorCallback ) : void ;
249255 removeSilentRenewError ( callback : UserManagerEvents . SilentRenewErrorCallback ) : void ;
250256
257+ /** Subscribe to events raised when the user's signed-in */
258+ addUserSignedIn ( callback : UserManagerEvents . UserSignedInCallback ) : void ;
259+ removeUserSignedIn ( callback : UserManagerEvents . UserSignedInCallback ) : void ;
260+
251261 /** Subscribe to events raised when the user's sign-in status at the OP has changed */
252262 addUserSignedOut ( callback : UserManagerEvents . UserSignedOutCallback ) : void ;
253263 removeUserSignedOut ( callback : UserManagerEvents . UserSignedOutCallback ) : void ;
@@ -261,6 +271,7 @@ export namespace UserManagerEvents {
261271 export type UserLoadedCallback = ( user : User ) => void ;
262272 export type UserUnloadedCallback = ( ) => void ;
263273 export type SilentRenewErrorCallback = ( error : Error ) => void ;
274+ export type UserSignedInCallback = ( ) => void ;
264275 export type UserSignedOutCallback = ( ) => void ;
265276 export type UserSessionChangedCallback = ( ) => void ;
266277}
@@ -300,6 +311,10 @@ export interface UserManagerSettings extends OidcClientSettings {
300311 readonly userStore ?: WebStorageStateStore ;
301312}
302313
314+ export interface ClockService {
315+ getEpochTime ( ) : Promise < number > ;
316+ }
317+
303318export interface WebStorageStateStoreSettings {
304319 prefix ?: string ;
305320 store ?: any ;
@@ -328,9 +343,12 @@ export class WebStorageStateStore implements StateStore {
328343}
329344
330345export interface SigninResponse {
331- new ( url : string , delimiter ?: string ) : SigninResponse ;
346+ new ( url : string , delimiter ?: string ) : SigninResponse ;
332347
333348 access_token : string ;
349+ /** Refresh token returned from the OIDC provider (if requested, via the
350+ * 'offline_access' scope) */
351+ refresh_token ?: string ;
334352 code : string ;
335353 error : string ;
336354 error_description : string ;
@@ -349,7 +367,7 @@ export interface SigninResponse {
349367}
350368
351369export interface SignoutResponse {
352- new ( url : string ) : SignoutResponse ;
370+ new ( url : string ) : SignoutResponse ;
353371
354372 error ?: string ;
355373 error_description ?: string ;
@@ -506,9 +524,9 @@ export class CordovaIFrameNavigator {
506524
507525export interface OidcMetadata {
508526 issuer : string ;
509- authorization_endpoint :string ;
527+ authorization_endpoint : string ;
510528 token_endpoint : string ;
511- token_endpoint_auth_methods_supported :string [ ] ;
529+ token_endpoint_auth_methods_supported : string [ ] ;
512530 token_endpoint_auth_signing_alg_values_supported : string [ ] ;
513531 userinfo_endpoint : string ;
514532 check_session_iframe : string ;
@@ -545,7 +563,7 @@ export interface OidcMetadata {
545563}
546564
547565export interface CheckSessionIFrame {
548- new ( callback : ( ) => void , client_id : string , url : string , interval ?: number , stopOnError ?: boolean ) : CheckSessionIFrame
566+ new ( callback : ( ) => void , client_id : string , url : string , interval ?: number , stopOnError ?: boolean ) : CheckSessionIFrame
549567
550568 load ( ) : Promise < void > ;
551569
0 commit comments