Changeset View
Changeset View
Standalone View
Standalone View
swh/auth/django/backends.py
Show First 20 Lines • Show All 69 Lines • ▼ Show 20 Lines | To use that backend globally in your django application, proceed as follow: | ||||
in django settings | in django settings | ||||
* add ``swh.auth.django.views.urlpatterns`` to your django application URLs | * add ``swh.auth.django.views.urlpatterns`` to your django application URLs | ||||
* add an HTML link targeting the ``"oidc-login"`` django view in your | * add an HTML link targeting the ``"oidc-login"`` django view in your | ||||
application views | application views | ||||
* once a user is logged in, add an HTML link targeting the ``"oidc-logout"`` | * once a user is logged in, add an HTML link targeting the ``"oidc-logout"`` | ||||
django view in your application views (a ``next_path`` query parameter | django view in your application views (a ``next`` query parameter | ||||
can be used to redirect to a view of choice once the user is logged out) | can be used to redirect to a view of choice once the user is logged out) | ||||
""" | """ | ||||
def authenticate( | def authenticate( | ||||
self, request: HttpRequest, code: str, code_verifier: str, redirect_uri: str | self, request: HttpRequest, code: str, code_verifier: str, redirect_uri: str | ||||
) -> Optional[OIDCUser]: | ) -> Optional[OIDCUser]: | ||||
▲ Show 20 Lines • Show All 138 Lines • Show Last 20 Lines |