Giter Site home page Giter Site logo

Comments (8)

KonstantinSchubert avatar KonstantinSchubert commented on May 28, 2024

I am having the suspicion that in my views, the @login_required - wrapper activates the redirect of the default django login system instead of the django-shibboleth-remoteuser. I have the suspicion that this default login system is responsible for creating the malformed redirect url.

from django-shibboleth-remoteuser.

lawlesst avatar lawlesst commented on May 28, 2024

I'll look into the target vs. next issue. Target works for us. This probably needs to be configurable.

For your second question, the default auth shouldn't be a problem. I don't deactivate it for our projects. Could you paste a snippet here showing how you are using it?

from django-shibboleth-remoteuser.

KonstantinSchubert avatar KonstantinSchubert commented on May 28, 2024

Target works for me as well, the issue is that something in my software stack writes the url incorrectly with "?next="

mydomain/Shibboleth.sso/Login?next=redirectUrl

(See screenshot: screenshot from 2014-07-30 16 37 05
)

. Here are the relevant parts of my settings.py: http://pastebin.com/6zL6Nmb6

So I am trying to find the stupid thing that puts "next" in this url. Because your code correctly uses "target" : https://github.com/KonstantinSchubert/django-shibboleth-remoteuser/blob/master/shibboleth/views.py#L56

from django-shibboleth-remoteuser.

KonstantinSchubert avatar KonstantinSchubert commented on May 28, 2024

The issue is solved if I replace

@login_required

with

@login_required(redirect_field_name='target')

The default value seems to be

django.contrib.auth.REDIRECT_FIELD_NAME='next' 

it might be possible to change this globlly in the settings. I tried adding

from django.contrib.auth import REDIRECT_FIELD_NAME
REDIRECT_FIELD_NAME = 'target'

but it had no effect.

from django-shibboleth-remoteuser.

KonstantinSchubert avatar KonstantinSchubert commented on May 28, 2024

I think there is a better way to solve this: Make use of the login-view when logging in. The user should be routet via /shib/login/ in the same way it happens during the logout.

from django-shibboleth-remoteuser.

jrhoads avatar jrhoads commented on May 28, 2024

It has been a couple of years since this issue was submitted (as well as the PR). @bcail and @KonstantinSchubert do you think this is still an issue or have things changed?

from django-shibboleth-remoteuser.

audiolion avatar audiolion commented on May 28, 2024

?next= definitely does not work with default Shibboleth implementations, it expects it to be ?target=

from django-shibboleth-remoteuser.

 avatar commented on May 28, 2024

Uncertain if the conditions are the same as OP, but this happens when the admin site is protected by Shibboleth. Basically, follow the setup in the readme with /admin in the Shibbolized Location directive, and add a urlconf like url(r'^admin/login/$', RedirectView.as_view(url=settings.LOGIN_URL, permanent=False, query_string=True)). This generates a redirect to the IdP with ?next= as parameter.

In this particular case, it seems to be due to a combination of an admin quirk (it does not honor LOGIN_URL) and not being able to pass redirect_field_name to RedirectView

from django-shibboleth-remoteuser.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.