@@ -92,6 +92,13 @@ export interface UserManagerSettings extends OidcClientSettings {
9292 */
9393 maxSilentRenewTimeoutRetries ?: number ;
9494
95+ /**
96+ * By default the user object only preserves the standard properties
97+ * (access_token, session_state, id_token, refresh_token, token_type, scope, profile, and expiration).
98+ * Any additional properties returned by the OIDC/OAuth2 token response will be ignored unless explicitly listed here. (default: [])
99+ */
100+ extraTokenResponseKeys ?: string [ ] ;
101+
95102 /**
96103 * Storage object used to persist User for currently authenticated user (default: window.sessionStorage, InMemoryWebStorage iff no window).
97104 * E.g. `userStore: new WebStorageStateStore({ store: window.localStorage })`
@@ -136,6 +143,8 @@ export class UserManagerSettingsStore extends OidcClientSettingsStore {
136143 public readonly accessTokenExpiringNotificationTimeInSeconds : number ;
137144 public readonly maxSilentRenewTimeoutRetries ?: number ;
138145
146+ public readonly extraTokenResponseKeys : string [ ] ;
147+
139148 public readonly userStore : StateStore ;
140149
141150 public constructor ( args : UserManagerSettings ) {
@@ -169,9 +178,10 @@ export class UserManagerSettingsStore extends OidcClientSettingsStore {
169178 includeIdTokenInSilentSignout = false ,
170179
171180 accessTokenExpiringNotificationTimeInSeconds = DefaultAccessTokenExpiringNotificationTimeInSeconds ,
172-
173181 maxSilentRenewTimeoutRetries,
174182
183+ extraTokenResponseKeys = [ ] ,
184+
175185 userStore,
176186 } = args ;
177187
@@ -206,6 +216,7 @@ export class UserManagerSettingsStore extends OidcClientSettingsStore {
206216
207217 this . accessTokenExpiringNotificationTimeInSeconds = accessTokenExpiringNotificationTimeInSeconds ;
208218 this . maxSilentRenewTimeoutRetries = maxSilentRenewTimeoutRetries ;
219+ this . extraTokenResponseKeys = extraTokenResponseKeys ;
209220
210221 if ( userStore ) {
211222 this . userStore = userStore ;
0 commit comments