Franpastoragusti / oidc-react-app

Oidc Client implementation with React Context and react-router-dom, to manage the auth process and manage private and public routes
43 stars 23 forks source link

Update callback.jsx #3

Closed svict4 closed 4 years ago

svict4 commented 5 years ago

fixes #1 infinite loop

synaptic-cleft commented 4 years ago

Hi there,

I have a similar issue. I got the code, adjusted the configuration and ran it. At / I get a console log that the user is not found. When I go to /private, I get a login screen. After providing my credentials for keycloak in my case, I get redirected to / with the state and the access_token in the URL.

The local storage is not updated with the tokens.

Your callback change does not solve this issue.

I assume, the issue is on my side as no one else mentioned this here. Any idea what I'm doing wrong?

Franpastoragusti commented 4 years ago

Hi there,

I have a similar issue. I got the code, adjusted the configuration and ran it. At / I get a console log that the user is not found. When I go to /private, I get a login screen. After providing my credentials for keycloak in my case, I get redirected to / with the state and the access_token in the URL.

The local storage is not updated with the tokens.

Your callback change does not solve this issue.

I assume, the issue is on my side as no one else mentioned this here. Any idea what I'm doing wrong?

Maybe the issue is in your redirect url, you should be redirected to the callback page and as you said you are being redirecting to / instad of /signin-oidc where the callback component is used

Check your IDENTITY_CONFIG VARIABLE and ensure that the redirect_uri matches with the url where you have the callback.

I'm now updating the versions of the repository and some changes that I have apply to improve the approach. But in this case the issue I guess that is in this config