Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redirect to page user came from #13

Open
hutchcodes opened this issue Jan 2, 2020 · 2 comments
Open

Redirect to page user came from #13

hutchcodes opened this issue Jan 2, 2020 · 2 comments

Comments

@hutchcodes
Copy link

Is it possible to have the user returned to the page they left when they started the login process?

  1. User is on myapp.com/foo
  2. User clicks login and goes through the login process at the IDP
  3. User is returned to myapp.com/oidc/callbacks/authentication-redirect
  4. User is redirected to myapp.com (I'd expect myapp.com/foo)
@ghidello
Copy link
Member

ghidello commented Jan 3, 2020

Very good point!
For now I think that the easiest way for achieving this would be to use the popup interaction so that the route in the main application will not change.
In order to save the path and go back to it after a redirection I'll have to setup some hooks for configuring the oidc state setting the path and for using it after the redirection. I'll work on it.

@ghidello
Copy link
Member

ghidello commented Jan 8, 2020

I just pushed a new version of the library that contains some hooks on the login and logout methods and some configuration options for enabling the "redirect to caller" page. You can see them in action in the example site:

settings.UseRedirectToCallerAfterAuthenticationRedirect();
settings.UseRedirectToCallerAfterLogoutRedirect();

Let me know if you'll have a chance to test it out

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants