I am setting up keycloak for a django project and this is the error I receive:
IntegrityError at /oidccallback/UNIQUE constraint failed: auth_user.usernameRequest Method:
GET
It looks like when I log in, keycloak tries to create my user again, even though my user is in the database.
Also, my usernames are hashed in the auth_user table in the database.
This is my code in my settings.py:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_DIR / 'db.sqlite3',
}
}
I also tried setting the OIDC_CREATE_USER setting to False but that only
prevented django from from detecting login sessions (which still were
created properly).
Any ideas on what is going wrong and how I can fix it?