simple_openid_connect.integrations.django.views

View functions which handle openid authentication and their related callbacks

Classes

FrontChannelLogoutNotificationView(**kwargs)

A view which handles Openid front-channel logout notifications by logging out the current session

InitLoginView(**kwargs)

The view which handles initiating a login.

LoginCallbackView(**kwargs)

The view which handles login callbacks.

LogoutView(**kwargs)

The view which handles logging a user out.

class simple_openid_connect.integrations.django.views.FrontChannelLogoutNotificationView(**kwargs)[source]

A view which handles Openid front-channel logout notifications by logging out the current session

class simple_openid_connect.integrations.django.views.InitLoginView(**kwargs)[source]

The view which handles initiating a login.

It essentially redirects the user agent to the Openid provider.

class simple_openid_connect.integrations.django.views.LoginCallbackView(**kwargs)[source]

The view which handles login callbacks.

It handles an authentication response from the Openid provider that is encoded in the current url by either logging the user in or rendering the error.

Error rendering can be customized by overwriting the template simple_openid_connect/login_failed.html which receives the context token_response of type TokenErrorResponse.

check_auth_state(request: HttpRequest) HttpResponse | None[source]

Prevent CSRF attacks by verifying the requests state parameter

ref: https://simple-openid-connect.readthedocs.io/en/stable/nonce_and_state.html

check_login_timeout(request: HttpRequest) HttpResponse | None[source]

Don’t allow login completion if the process was started too long ago

exchange_code_for_token(request: HttpRequest) HttpResponse | TokenSuccessResponse[source]

Exchange the code encoded in the current URL for an access token

extract_id(request: HttpRequest, token_response: TokenSuccessResponse) HttpResponse | IdToken[source]

Extract the validated ID token from the given token response

perform_login(request: HttpRequest, token_response: TokenSuccessResponse, id_token: IdToken) Any[source]

Perform internal user object maintenance and authentication after having performed all external communication

This handles federated user information (create a new user if necessary or update local info) and logs the user in.

class simple_openid_connect.integrations.django.views.LogoutView(**kwargs)[source]

The view which handles logging a user out.