Completing login after signInRedirect
See original GitHub issueHi,
We are trying to switch to this library instead of vanilla oidc-client
.
In our previous implementation, after calling signInRedirect
when the authentication is returned, our redirect_url
page contains code that will complete the login by calling userManager.signinRedirectCallback()
which completes the authentication by exchanging the authorization code for an access token.
I can’t find an example of how this is done in the library.
I would also like to know if this library handles silentRenewal
and how to implement.
Issue Analytics
- State:
- Created 2 years ago
- Comments:12 (11 by maintainers)
Top Results From Across the Web
Oidc-client-js trigger login when app start.What is the ...
I am trying to trigger login redirect when application start. First i tried this code; ... after that, everything works good.
Read more >signInWithRedirect - how to choose where to redirect to?
Hi Friends, I have successfully added login with both IDP and ... option in the config (and add the matching Sign in redirect...
Read more >Redirect Users
To see an example of how this works, try the React: Login Quickstart. ... often the URL to which users are redirected once...
Read more >Redirecting back to the client
Redirecting back to the client. The Return URL and the Login Workflow. Once the user has been logged in, they must complete the...
Read more >Authenticate Using Google with JavaScript - Firebase
Handle the sign-in flow with the Firebase SDK · Create an instance of the Google provider object: · Optional: Specify additional OAuth 2.0...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi, so I figured out why it wasn’t working, posting here in case someone else runs into this :
You must provide an implementation of onSigninCallback to the conf to remove the parameters from the URL upon successful login. Otherwise if you refresh the page and the params are still there the silent login won’t work.
I know an example is provided in your code, but it would be really useful to add it to the readme too, it took me a while to find it.
For anyone reading this and having the same issue :
const onSigninCallback = (): void => { window.history.replaceState({}, document.title, window.location.pathname); };
With this you don’t need the effect I posted above.
Best
Sorry, it took a while but I just created the PR. Hope it’ll be useful. All the best.