I recently upgraded my Keycloak instance to a newer version, and after the upgrade, I’m experiencing an authentication failure with my OIDC client. Upon checking the JWT token, I noticed that the subject (“sub”) claim is missing.
My questions are:
Is the missing “sub” claim the reason for the failed authentication?
Is there any way to handle authentication without the “sub” claim?
No, as you actually have a token, the user is already authenticated succesfully. If your application can‘t handle it, it‘s not related to the authentication itself.
Most likely during the upgrade, your client was not configured to use the new „basic“ client scope as default. The „sub“ claim was moved to this scope. Add it as a default scope to your client config and you are good to go.
I already have the basic claim in the client, but still having issues with the sub claim. The authorization is successful, but the token exchange fails. Any ideas?