0002-auth_oidc-make-autorun-go-directly-to-the-OP-27135.patch
src/authentic2_auth_oidc/models.py | ||
---|---|---|
31 | 31 |
AuthenticatorRelatedObjectBase, |
32 | 32 |
BaseAuthenticator, |
33 | 33 |
) |
34 |
from authentic2.utils.misc import make_url, redirect_to_login
|
|
34 |
from authentic2.utils.misc import make_url |
|
35 | 35 |
from authentic2.utils.template import validate_template |
36 | 36 | |
37 | 37 |
from . import managers |
... | ... | |
233 | 233 |
return '<OIDCProvider %r>' % self.issuer |
234 | 234 | |
235 | 235 |
def autorun(self, request, block_id, next_url): |
236 |
return redirect_to_login(
|
|
237 |
request, login_url='oidc-login', kwargs={'pk': self.pk}, params={'next': next_url} |
|
238 |
) |
|
236 |
from . import views
|
|
237 | ||
238 |
return views.oidc_login(request, pk=self.pk, next_url=next_url)
|
|
239 | 239 | |
240 | 240 |
def login(self, request, *args, **kwargs): |
241 | 241 |
context = kwargs.get('context', {}).copy() |
tests/test_auth_oidc.py | ||
---|---|---|
492 | 492 |
slug='password-authenticator', defaults={'enabled': False} |
493 | 493 |
) |
494 | 494 |
response = app.get('/login/', status=302) |
495 |
assert response['Location'] == '/accounts/oidc/login/%s/?next=/' % oidc_provider.pk
|
|
495 |
assert response['Location'].startswith('https://server.example.com/authorize')
|
|
496 | 496 | |
497 | 497 | |
498 | 498 |
def test_sso(app, caplog, code, oidc_provider, oidc_provider_jwkset, hooks): |
499 |
- |