maxmantz/redux-oidc

Using the library with authorization code + PKCE

sinanmb opened this issue · 1 comments

Hi, first of all thank you for this great library, it's very useful!

I'm working on the OHIF viewer, which is setup with redux-oidc; I successfully setup the implicit flow using these values and was able to login.

However, I later realized that Keycloak (the authorization server i use) doesn't support silent renew for the implicit flow, therefore I've tried to setup the authorization code + PKCE flow, however I'm getting stuck. I followed the example here for the setup, and receive an authorization code in my Callback component.

What is the next step? I was under the impression the library would exchange the authorization code for an access token, however it seems I misconfigured something?

I appreciate any pointers.

This is the config I am using

   {
      // Authorization Server URL
      authority: 'http://localhost:8080/auth/realms/<realmId>',
      client_id: '<clientId>',
      redirect_uri: 'http://localhost:3000/callback', // `OHIFStandaloneViewer.js`
      response_type: 'code',
      scope: 'openid email',
      grantType: 'authorization_code',
      automaticSilentRenew: true,
      revokeAccessTokenOnSignout: true,
      loadUserInfo: true,
    }

The problem was that I had a conditional rendering of the CallbackComponent, and thus prevented the second part of the authorization code flow.