Setup for local user storage

By local user storage a User object get created for every logged in identity. This can be handy when you want to link objects to this User. If that’s not the case please read the scenario Setup for remote user.

Since this is the default behaviour for Django Keycloak you don’t have to configure any setting.

Important to point out the KEYCLOAK_OIDC_PROFILE_MODEL setting. This should contain django_keycloak.OpenIdConnectProfile (which is the case by default). The model to store the Open ID Connect profile is a swappable model. When configured to this model a foreign key to the configured Django User model is available.

# settings.py
KEYCLOAK_OIDC_PROFILE_MODEL = 'django_keycloak.OpenIdConnectProfile'