0

I'm using Auth0 with oidc-client (latest 1.10.1).

Now what I'm trying to do is to use PKCE flow instead of the implicit one and in AuthModule I have the following config for oidc:

NgOidcClientModule.forRoot({
      // prettier-ignore
      oidc_config: {
        authority: environment.sts.authority,
        client_id: environment.sts.clientId,
        redirect_uri: `${environment.appRoot}oidc-login-redirect-callback.html`,
        scope: 'openid profile email',
        response_type: 'code',
        post_logout_redirect_uri: `${environment.appRoot}oidc-logout-redirect-callback.html`,
        silent_redirect_uri: `${environment.appRoot}oidc-silent-renew-redirect-callback.html`,
        accessTokenExpiringNotificationTime: 10,
        automaticSilentRenew: true,
        metadata: {
          authorization_endpoint: `${environment.sts.authority}authorize?audience=${environment.sts.audience}`,
          userinfo_endpoint: `${environment.sts.authority}userinfo`,
          issuer: environment.sts.authority,
          jwks_uri: `${environment.sts.authority}.well-known/jwks.json`,
          // tslint:disable-next-line:max-line-length
          end_session_endpoint: `${environment.sts.authority}v2/logout?returnTo=${environment.appRootEncoded + 'oidc-logout-redirect-callback.html'}&client_id=${environment.sts.clientId}`
        },
        userStore: (() => new WebStorageStateStore({ store: window.localStorage })) as any
      }
    }),

I had to change response_type value from id_token toke to code.

Another thing I read that I need to change is in the static pages:

var config = {
        userStore: new Oidc.WebStorageStateStore({ store: window.localStorage }),
        response_mode: 'query',
      };
var mgr = new Oidc.UserManager(config);

I understood that I need to add response_mode: 'query' for Oidc.UserManager config.

All good for now, but I think that I'm missing something because I'm infinitely redirected.

Are there some extra settings I need to do in Auth0 Application?

Sergiu Molnar
  • 865
  • 1
  • 11
  • 22

1 Answers1

0

I found the solution: downgrade to oidc-client": "^1.8.2

Sergiu Molnar
  • 865
  • 1
  • 11
  • 22