@@ -81,8 +81,8 @@ export interface MetadataServiceCtor {
8181}
8282
8383export interface ResponseValidator {
84- validateSigninResponse ( state : any , response : any ) : Promise < any > ;
85- validateSignoutResponse ( state : any , response : any ) : Promise < any > ;
84+ validateSigninResponse ( state : any , response : any ) : Promise < SigninResponse > ;
85+ validateSignoutResponse ( state : any , response : any ) : Promise < SignoutRespsone > ;
8686}
8787
8888export interface ResponseValidatorCtor {
@@ -102,43 +102,48 @@ export interface SignoutRequest {
102102export class OidcClient {
103103 constructor ( settings : OidcClientSettings ) ;
104104
105+ readonly settings : OidcClientSettings ;
106+
105107 createSigninRequest ( args ?: any ) : Promise < SigninRequest > ;
106- processSigninResponse ( ) : Promise < any > ;
108+ processSigninResponse ( url : string , stateStore : StateStore ) : Promise < SigninResponse > ;
107109
108110 createSignoutRequest ( args ?: any ) : Promise < SignoutRequest > ;
109- processSignoutResponse ( ) : Promise < any > ;
111+ processSignoutResponse ( url : string , stateStore : StateStore ) : Promise < SignoutResponse > ;
110112
111113 clearStaleState ( stateStore : StateStore ) : Promise < any > ;
112114}
113115
114116export interface OidcClientSettings {
115117 authority ?: string ;
116- metadataUrl ?: string ;
118+ readonly metadataUrl ?: string ;
117119 metadata ?: any ;
118120 signingKeys ?: any [ ] ;
119121 client_id ?: string ;
120- response_type ?: string ;
121- scope ?: string ;
122- redirect_uri ?: string ;
123- post_logout_redirect_uri ?: string ;
124- popup_post_logout_redirect_uri ?: string ;
125- prompt ?: string ;
126- display ?: string ;
127- max_age ?: number ;
128- ui_locales ?: string ;
129- acr_values ?: string ;
130- filterProtocolClaims ?: boolean ;
131- loadUserInfo ?: boolean ;
132- staleStateAge ?: number ;
133- clockSkew ?: number ;
134- stateStore ?: StateStore ;
122+ readonly response_type ?: string ;
123+ readonly scope ?: string ;
124+ readonly redirect_uri ?: string ;
125+ readonly post_logout_redirect_uri ?: string ;
126+ readonly popup_post_logout_redirect_uri ?: string ;
127+ readonly prompt ?: string ;
128+ readonly display ?: string ;
129+ readonly max_age ?: number ;
130+ readonly ui_locales ?: string ;
131+ readonly acr_values ?: string ;
132+ readonly filterProtocolClaims ?: boolean ;
133+ readonly loadUserInfo ?: boolean ;
134+ readonly staleStateAge ?: number ;
135+ readonly clockSkew ?: number ;
136+ readonly stateStore ?: StateStore ;
135137 ResponseValidatorCtor ?: ResponseValidatorCtor ;
136138 MetadataServiceCtor ?: MetadataServiceCtor ;
139+ extraQueryParams ?: { } ;
137140}
138141
139142export class UserManager extends OidcClient {
140143 constructor ( settings : UserManagerSettings ) ;
141144
145+ readonly settings : UserManagerSettings ;
146+
142147 clearStaleState ( ) : Promise < void > ;
143148
144149 getUser ( ) : Promise < User > ;
@@ -186,24 +191,27 @@ export interface UserManagerEvents extends AccessTokenEvents {
186191
187192 addUserSignedOut ( callback : ( ...ev : any [ ] ) => void ) : void ;
188193 removeUserSignedOut ( callback : ( ...ev : any [ ] ) => void ) : void ;
194+
195+ addUserSessionChanged ( callback : ( ...ev : any [ ] ) => void ) : void ;
196+ removeUserSessionChanged ( callback : ( ...ev : any [ ] ) => void ) : void ;
189197}
190198
191199export interface UserManagerSettings extends OidcClientSettings {
192- popup_redirect_uri ?: string ;
193- popupWindowFeatures ?: string ;
194- popupWindowTarget ?: any ;
195- silent_redirect_uri ?: any ;
196- silentRequestTimeout ?: any ;
197- automaticSilentRenew ?: boolean ;
198- includeIdTokenInSilentRenew ?: boolean ;
199- monitorSession ?: boolean ;
200- checkSessionInterval ?: number ;
201- revokeAccessTokenOnSignout ?: any ;
202- accessTokenExpiringNotificationTime ?: number ;
203- redirectNavigator ?: any ;
204- popupNavigator ?: any ;
205- iframeNavigator ?: any ;
206- userStore ?: any ;
200+ readonly popup_redirect_uri ?: string ;
201+ readonly popupWindowFeatures ?: string ;
202+ readonly popupWindowTarget ?: any ;
203+ readonly silent_redirect_uri ?: any ;
204+ readonly silentRequestTimeout ?: any ;
205+ readonly automaticSilentRenew ?: boolean ;
206+ readonly includeIdTokenInSilentRenew ?: boolean ;
207+ readonly monitorSession ?: boolean ;
208+ readonly checkSessionInterval ?: number ;
209+ readonly revokeAccessTokenOnSignout ?: any ;
210+ readonly accessTokenExpiringNotificationTime ?: number ;
211+ readonly redirectNavigator ?: any ;
212+ readonly popupNavigator ?: any ;
213+ readonly iframeNavigator ?: any ;
214+ readonly userStore ?: any ;
207215}
208216
209217export interface WebStorageStateStoreSettings {
@@ -233,7 +241,39 @@ export class WebStorageStateStore implements StateStore {
233241 getAllKeys ( ) : Promise < string [ ] > ;
234242}
235243
236- export interface User {
244+ export interface SigninResponse {
245+ new ( url : string ) : SigninResponse ;
246+
247+ access_token : string ;
248+ error : string ;
249+ error_description : string ;
250+ error_uri : string ;
251+ expires_at : number ;
252+ id_token : string ;
253+ profile : any ;
254+ scope : string ;
255+ session_state : any ;
256+ state : any ;
257+ token_type : string ;
258+
259+ readonly expired : boolean | undefined ;
260+ readonly expires_in : number | undefined ;
261+ readonly isOpenIdConnect : boolean ;
262+ readonly scopes : string [ ] ;
263+ }
264+
265+ export interface SignoutRespsone {
266+ new ( url : string ) : SignoutResponse ;
267+
268+ error : string ;
269+ error_description : string ;
270+ error_uri : string ;
271+ state : any ;
272+ }
273+
274+ export class User {
275+ constructor ( response : SigninResponse ) ;
276+
237277 id_token : string ;
238278 session_state : any ;
239279 access_token : string ;
@@ -261,4 +301,4 @@ export class CordovaPopupNavigator {
261301
262302export class CordovaIFrameNavigator {
263303 prepare ( params : any ) : Promise < CordovaPopupWindow > ;
264- }
304+ }
0 commit comments