bjerkio/oidc-react

Add compatibility with Ionic React

TalaatHarb opened this issue · 3 comments

This is a feature request, of adding Basic compatibility with Ionic React,
Currently it almost works, as it does the redirect for the authority and receives the token and saves it storage but it keeps looping and refreshing the page after that which is a shame.

Steps to reproduce:

  • build a new Ionic React app by using the the ionic wizard 'ionic start'
  • install oidc-react
  • add oidc config as normal react project with a valid authority and client id and redirect_uri = 'http://localhost:8100'
  • start the application and observe looping behavior 'ionic serve'

@TalaatHarb this may not be related to Ionic specifically. This might be a bug I introduced last Friday.

Are you using autoSignIn or do you have it disabled by chance?

I have been using default configuration as mentioned in the getting started guide
so basically:

const oidcConfig = {
  onSignIn: () => {
    // Redirect?
  },
  authority: 'https://oidc.io/oauth',
  clientId: 'this-is-a-client-id',
  redirectUri: 'https://my-app.com/'
};

nothing fancy,
it might be the way routing is handled in Ionic or it might be the specific authority I used (keycloak) because the loop the application got stuck in included calling /openid-configuration end point

However using the same authority in a normal create-react-app template didn't cause that issue

Yea, I'm pretty sure this is a bug I introduced. Looking into it now.