Repository navigation
Duplicate key value violates unique constraint "constraint_40" #42586
Unanswered
betonetotbo
asked this question in
Q&A
Replies: 1 comment
|
The error message indicates that the user's link to this IDP is created twice, thus the unique constraint violation: Where the latter uuid is Keycloak's internal user id, ie. you cannot link a user to the same IDP twice. Is the custom SPI messing with the federated user context? |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
In our environment, we are running Keycloak 26.1.2 with 2 replicas.
Yesterday, we deployed a new feature that includes a custom SPI. This SPI performs an HTTP request to another internal service within our infrastructure. Its implementation is relatively straightforward.
The SPI in question is an IdpAuthenticator, configured within a custom authentication flow. This flow is only executed during the first login attempt through a SAML Identity Provider (IdP).
Following the deployment of this upgrade, during functional testing, we consistently encountered an HTTP 500 error immediately after a successful SAML login. The error is triggered after the execution of our custom SPI.
Below is the captured call stack from the error log:
This is the first login saml flow:
Due to this error, we were unable to log in with the user user@saml.com.
The only way to resolve the issue was by restarting all Keycloak instances to ensure that the embedded Infinispan cache was fully discarded.
Any idea about what can I review on my authentication flow or my SPI implementation?
All reactions