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

How to remember prior-login url? #154

Open
lcmgh opened this issue Apr 3, 2024 · 1 comment
Open

How to remember prior-login url? #154

lcmgh opened this issue Apr 3, 2024 · 1 comment

Comments

@lcmgh
Copy link

lcmgh commented Apr 3, 2024

Hi!

From my understanding the only way to let my app redirect the user to the original accessed url (the one prior the oauth redirect) is to encode the path within the redirect_uri when server side storage is not desired.

Is the recommended approach to copy the client and adapt the redirect_uri?

I tried to use add_auth_context_value as an alternative "storage" but type AuthenticationContextClass is private.

Thanks

@lcmgh lcmgh changed the title Dynamic auth url How to remember prior-login url? Apr 3, 2024
@ramosbugs
Copy link
Owner

I'd suggest using the state value to carry arbitrary payload in addition to a CSRF token (e.g., as a base64url-encoded JSON blob). The OIDC provider will include the state you provide in the redirect back to your app, from which you can extract the original URL. Some providers may have a size limitation if the state is very big, in which case you could consider browser storage as an alternative to server-side storage.

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