-
Notifications
You must be signed in to change notification settings - Fork 169
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 url from "?next=" won't be loaded after successful authentication, even when OIDC_REDIRECT_FIELD_NAME="next" is set. #485
Comments
I have the same exact problem, the |
Same here. How to solve this? |
I solved this issue, in my usecase. For me, the problem was that I set up logging in as an 'a' element, as described here, when it should have been set up as a get form that includes a next parameter <form method="get" action="{% url 'oidc_authentication_init' %}">
<input type="hidden" name="next" value="{{ next }}" />
<input type="submit" value="Submit">
</form> or see my template. |
You can solve this issue by creating a custom login redirect view that gets the next query param and appends it to in urls.py in views.py
This way instead of calling the url 'oidc_authentication_init' in the template or anywhere else you just call the custom login url. |
Hey man, did you make it? I'm with the same problem |
In my application both the standard django authentication (
django.contrib.auth.backends.ModelBackend
) and the mozilla django oidc backend (mozilla_django_oidc.auth.OIDCAuthenticationBackend
) can be used to authenticate users. TheLOGIN_REDIRECT_URL
is not explicitly set.?next=/somepage/
parameter from the url is catched and after login the correct redirect url is loaded.OIDC_REDIRECT_FIELD_NAME="next"
which it should be by default, the next argument is somehow lost during the authentication process. After successful authentication, the application always forwards to the default url:/accounts/profile
.Is this an issue of mozilla-django-oidc or is it required that the OIDC server somehow passes the next parameter along and maybe is not doing that?
The text was updated successfully, but these errors were encountered: