auth_oidc: make autorun go directly to the OP (#27135)
This commit is contained in:
parent
f34b2af379
commit
9d0d83b0e5
|
@ -31,7 +31,7 @@ from authentic2.apps.authenticators.models import (
|
|||
AuthenticatorRelatedObjectBase,
|
||||
BaseAuthenticator,
|
||||
)
|
||||
from authentic2.utils.misc import make_url, redirect_to_login
|
||||
from authentic2.utils.misc import make_url
|
||||
from authentic2.utils.template import validate_template
|
||||
|
||||
from . import managers
|
||||
|
@ -233,9 +233,9 @@ class OIDCProvider(BaseAuthenticator):
|
|||
return '<OIDCProvider %r>' % self.issuer
|
||||
|
||||
def autorun(self, request, block_id, next_url):
|
||||
return redirect_to_login(
|
||||
request, login_url='oidc-login', kwargs={'pk': self.pk}, params={'next': next_url}
|
||||
)
|
||||
from . import views
|
||||
|
||||
return views.oidc_login(request, pk=self.pk, next_url=next_url)
|
||||
|
||||
def login(self, request, *args, **kwargs):
|
||||
context = kwargs.get('context', {}).copy()
|
||||
|
|
|
@ -492,7 +492,7 @@ def test_login_autorun(oidc_provider, app, settings):
|
|||
slug='password-authenticator', defaults={'enabled': False}
|
||||
)
|
||||
response = app.get('/login/', status=302)
|
||||
assert response['Location'] == '/accounts/oidc/login/%s/?next=/' % oidc_provider.pk
|
||||
assert response['Location'].startswith('https://server.example.com/authorize')
|
||||
|
||||
|
||||
def test_sso(app, caplog, code, oidc_provider, oidc_provider_jwkset, hooks):
|
||||
|
|
Loading…
Reference in New Issue