@@ -57,9 +57,11 @@ export class Log {
57
57
}
58
58
59
59
export interface MetadataService {
60
- new ( settings : OidcClientSettings ) : MetadataService ;
60
+ new ( settings : OidcClientSettings ) : MetadataService ;
61
61
62
62
metadataUrl ?: string ;
63
+
64
+ resetSigningKeys ( ) : void ;
63
65
64
66
getMetadata ( ) : Promise < OidcMetadata > ;
65
67
@@ -69,7 +71,7 @@ export interface MetadataService {
69
71
70
72
getUserInfoEndpoint ( ) : Promise < string > ;
71
73
72
- getTokenEndpoint ( ) : Promise < string | undefined > ;
74
+ getTokenEndpoint ( optional : boolean = true ) : Promise < string | undefined > ;
73
75
74
76
getCheckSessionIframe ( ) : Promise < string | undefined > ;
75
77
@@ -156,12 +158,16 @@ export interface OidcClientSettings {
156
158
readonly staleStateAge ?: number ;
157
159
/** 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) */
158
160
readonly clockSkew ?: number ;
161
+ readonly clockService ?: ClockService ;
159
162
readonly stateStore ?: StateStore ;
160
163
readonly userInfoJwtIssuer ?: 'ANY' | 'OP' | string ;
164
+ readonly mergeClaims ?: boolean ;
161
165
ResponseValidatorCtor ?: ResponseValidatorCtor ;
162
166
MetadataServiceCtor ?: MetadataServiceCtor ;
163
167
/** An object containing additional query string parameters to be including in the authorization request */
164
168
extraQueryParams ?: Record < string , any > ;
169
+
170
+ getEpochTime ( ) : Promise < number > ;
165
171
}
166
172
167
173
export class UserManager extends OidcClient {
@@ -248,6 +254,10 @@ export interface UserManagerEvents extends AccessTokenEvents {
248
254
addSilentRenewError ( callback : UserManagerEvents . SilentRenewErrorCallback ) : void ;
249
255
removeSilentRenewError ( callback : UserManagerEvents . SilentRenewErrorCallback ) : void ;
250
256
257
+ /** Subscribe to events raised when the user's signed-in */
258
+ addUserSignedIn ( callback : UserManagerEvents . UserSignedInCallback ) : void ;
259
+ removeUserSignedIn ( callback : UserManagerEvents . UserSignedInCallback ) : void ;
260
+
251
261
/** Subscribe to events raised when the user's sign-in status at the OP has changed */
252
262
addUserSignedOut ( callback : UserManagerEvents . UserSignedOutCallback ) : void ;
253
263
removeUserSignedOut ( callback : UserManagerEvents . UserSignedOutCallback ) : void ;
@@ -261,6 +271,7 @@ export namespace UserManagerEvents {
261
271
export type UserLoadedCallback = ( user : User ) => void ;
262
272
export type UserUnloadedCallback = ( ) => void ;
263
273
export type SilentRenewErrorCallback = ( error : Error ) => void ;
274
+ export type UserSignedInCallback = ( ) => void ;
264
275
export type UserSignedOutCallback = ( ) => void ;
265
276
export type UserSessionChangedCallback = ( ) => void ;
266
277
}
@@ -300,6 +311,10 @@ export interface UserManagerSettings extends OidcClientSettings {
300
311
readonly userStore ?: WebStorageStateStore ;
301
312
}
302
313
314
+ export interface ClockService {
315
+ getEpochTime ( ) : Promise < number > ;
316
+ }
317
+
303
318
export interface WebStorageStateStoreSettings {
304
319
prefix ?: string ;
305
320
store ?: any ;
@@ -328,9 +343,12 @@ export class WebStorageStateStore implements StateStore {
328
343
}
329
344
330
345
export interface SigninResponse {
331
- new ( url : string , delimiter ?: string ) : SigninResponse ;
346
+ new ( url : string , delimiter ?: string ) : SigninResponse ;
332
347
333
348
access_token : string ;
349
+ /** Refresh token returned from the OIDC provider (if requested, via the
350
+ * 'offline_access' scope) */
351
+ refresh_token ?: string ;
334
352
code : string ;
335
353
error : string ;
336
354
error_description : string ;
@@ -349,7 +367,7 @@ export interface SigninResponse {
349
367
}
350
368
351
369
export interface SignoutResponse {
352
- new ( url : string ) : SignoutResponse ;
370
+ new ( url : string ) : SignoutResponse ;
353
371
354
372
error ?: string ;
355
373
error_description ?: string ;
@@ -506,9 +524,9 @@ export class CordovaIFrameNavigator {
506
524
507
525
export interface OidcMetadata {
508
526
issuer : string ;
509
- authorization_endpoint :string ;
527
+ authorization_endpoint : string ;
510
528
token_endpoint : string ;
511
- token_endpoint_auth_methods_supported :string [ ] ;
529
+ token_endpoint_auth_methods_supported : string [ ] ;
512
530
token_endpoint_auth_signing_alg_values_supported : string [ ] ;
513
531
userinfo_endpoint : string ;
514
532
check_session_iframe : string ;
@@ -545,7 +563,7 @@ export interface OidcMetadata {
545
563
}
546
564
547
565
export 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
549
567
550
568
load ( ) : Promise < void > ;
551
569
0 commit comments