simple_openid_connect.integrations.django.decorators#

View-function decorators

Functions

access_token_required(*[, required_scopes])

Decorator for views that checks that the request is authenticated using a valid access token, early-returning an appropriate http error response if necessary.

simple_openid_connect.integrations.django.decorators.access_token_required(*, required_scopes: str | None = None) Callable[[...], HttpResponse | View_Return]#

Decorator for views that checks that the request is authenticated using a valid access token, early-returning an appropriate http error response if necessary.

Parameters:

required_scopes – Scopes to which the access token needs to have access. If not given, use the settings.OPENID_SCOPE value which defaults to “openid”.

Raises:

UnsupportedByProviderError – If the provider does not support token introspection.