mirror of
https://github.com/goauthentik/authentik.git
synced 2026-06-17 19:09:11 +03:00
sources/oauth: Fallback to id field when sub is missing in OIDC callback (#22672)
fix/oidc-callback-fallback-id-to-sub Signed-off-by: Vlad Kamerdinerov <61966975+v-kamerdinerov@users.noreply.github.com> Co-authored-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
committed by
GitHub
parent
3cbf5dac95
commit
5681abafa4
@@ -67,7 +67,7 @@ class OpenIDConnectOAuth2Callback(OAuthCallback):
|
|||||||
client_class = OpenIDConnectClient
|
client_class = OpenIDConnectClient
|
||||||
|
|
||||||
def get_user_id(self, info: dict[str, str]) -> str:
|
def get_user_id(self, info: dict[str, str]) -> str:
|
||||||
return info.get("sub", None)
|
return str(info.get("sub") or info.get("id"))
|
||||||
|
|
||||||
|
|
||||||
@registry.register()
|
@registry.register()
|
||||||
|
|||||||
Reference in New Issue
Block a user