Skip to content

Commit

Permalink
feat: default of loadUserInfo changed from true to false
Browse files Browse the repository at this point in the history
  • Loading branch information
pamapa committed Nov 2, 2021
1 parent 310b0f2 commit a0c056c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
1 change: 1 addition & 0 deletions docs/migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Ported library from JavaScript to TypeScript.
- renamed staleStateAge to staleStateAgeInSeconds
- removed ResponseValidatorCtor and MetadataServiceCtor, if needed OidcClient/UserManager class must be extended
- changed response_type, only code flow (PKCE) is supported
- default of loadUserInfo changed from true to false

**UserManagerSettings:**
- renamed accessTokenExpiringNotificationTime to accessTokenExpiringNotificationTimeInSeconds
Expand Down
10 changes: 6 additions & 4 deletions samples/Parcel/src/code-flow-identityserver/sample-settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,16 @@ export const settings = {
popup_post_logout_redirect_uri: url + "/sample-popup-signout.html",

silent_redirect_uri: url + "/sample-silent.html",
automaticSilentRenew:false,
automaticSilentRenew: false,
validateSubOnSilentRenew: true,
//silentRequestTimeout:10000,
//silentRequestTimeout: 10000,

monitorAnonymousSession : true,
loadUserInfo: true,

monitorAnonymousSession: true,

filterProtocolClaims: true,
revokeAccessTokenOnSignout : true,
revokeAccessTokenOnSignout: true,

//metadata: {"issuer":"https://demo.identityserver.io","jwks_uri":"https://demo.identityserver.io/.well-known/openid-configuration/jwks","authorization_endpoint":"https://demo.identityserver.io/connect/authorize","token_endpoint":"https://demo.identityserver.io/connect/token","userinfo_endpoint":"https://demo.identityserver.io/connect/userinfo","end_session_endpoint":"https://demo.identityserver.io/connect/endsession","check_session_iframe":"https://demo.identityserver.io/connect/checksession","revocation_endpoint":"https://demo.identityserver.io/connect/revocation","introspection_endpoint":"https://demo.identityserver.io/connect/introspect","device_authorization_endpoint":"https://demo.identityserver.io/connect/deviceauthorization","frontchannel_logout_supported":true,"frontchannel_logout_session_supported":true,"backchannel_logout_supported":true,"backchannel_logout_session_supported":true,"scopes_supported":["openid","profile","email","api","api.scope1","api.scope2","scope2","policyserver.runtime","policyserver.management","offline_access"],"claims_supported":["sub","name","family_name","given_name","middle_name","nickname","preferred_username","profile","picture","website","gender","birthdate","zoneinfo","locale","updated_at","email","email_verified"],"grant_types_supported":["authorization_code","client_credentials","refresh_token","implicit","password","urn:ietf:params:oauth:grant-type:device_code"],"response_types_supported":["code","token","id_token","id_token token","code id_token","code token","code id_token token"],"response_modes_supported":["form_post","query","fragment"],"token_endpoint_auth_methods_supported":["client_secret_basic","client_secret_post"],"id_token_signing_alg_values_supported":["RS256"],"subject_types_supported":["public"],"code_challenge_methods_supported":["plain","S256"],"request_parameter_supported":true},
//metadataSeed: {"some_extra_data":"some_value"},
Expand Down
5 changes: 3 additions & 2 deletions src/OidcClientSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export interface OidcClientSettings {

/** Should OIDC protocol claims be removed from profile (default: true) */
filterProtocolClaims?: boolean;
/** Flag to control if additional identity data is loaded from the user info endpoint in order to populate the user's profile (default: true) */
/** Flag to control if additional identity data is loaded from the user info endpoint in order to populate the user's profile (default: false) */
loadUserInfo?: boolean;
/** Number (in seconds) indicating the age of state entries in storage for authorize requests that are considered abandoned and thus can be cleaned up (default: 300) */
staleStateAgeInSeconds?: number;
Expand Down Expand Up @@ -119,7 +119,8 @@ export class OidcClientSettingsStore {
// optional protocol
prompt, display, max_age, ui_locales, acr_values, resource, response_mode,
// behavior flags
filterProtocolClaims = true, loadUserInfo = true,
filterProtocolClaims = true,
loadUserInfo = false,
staleStateAgeInSeconds = DefaultStaleStateAgeInSeconds,
clockSkewInSeconds = DefaultClockSkewInSeconds,
userInfoJwtIssuer = "OP",
Expand Down
2 changes: 1 addition & 1 deletion test/unit/OidcClientSettings.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ describe("OidcClientSettings", () => {
});

// assert
expect(subject.loadUserInfo).toEqual(true);
expect(subject.loadUserInfo).toEqual(false);
});

it("should return value from initial settings", () => {
Expand Down

0 comments on commit a0c056c

Please sign in to comment.