simple_openid_connect.integrations.django.models#
simple_openid_connect database models
Classes
|
A model to hold openid session information. |
|
A model which holds user related openid data. |
|
Custom user manager for the |
- class simple_openid_connect.integrations.django.models.OpenidSession(*args, **kwargs)#
A model to hold openid session information.
- exception DoesNotExist#
- exception MultipleObjectsReturned#
- class simple_openid_connect.integrations.django.models.OpenidUser(*args, **kwargs)#
A model which holds user related openid data.
It is related to the user model instances via the openid relation.
- exception DoesNotExist#
- exception MultipleObjectsReturned#
- update_session(token_response: TokenSuccessResponse) None#
Update session information based on the given openid token response.
If the token contains a session id, that session is updated with newer information and if not, a new session object is created.
- class simple_openid_connect.integrations.django.models.OpenidUserManager(*args, **kwargs)#
Custom user manager for the
OpenidUsermodel.- get_or_create_for_sub(sub: str, username: str | None = None) OpenidUser#
Dynamically get the existing user from the provided subject or create a new user if none already exists.
This also ensures that a django auth model user exists (with the given username if present). This method is intended to be used when minimal user information is known but things should still be linked to a user i.e. when this app serves as a resource server and receives its user information through access token introspection.
- get_or_create_from_id_token(id_token: IdToken) OpenidUser#
Dynamically get the existing user from the provided token or create a new user if none already exists.