From 5681abafa40ed7edc341d3cd8d3413d4b246d51a Mon Sep 17 00:00:00 2001 From: Vlad Kamerdinerov <61966975+v-kamerdinerov@users.noreply.github.com> Date: Wed, 3 Jun 2026 16:22:13 +0500 Subject: [PATCH] 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 --- authentik/sources/oauth/types/oidc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/authentik/sources/oauth/types/oidc.py b/authentik/sources/oauth/types/oidc.py index b6794fae87..97cfb43d49 100644 --- a/authentik/sources/oauth/types/oidc.py +++ b/authentik/sources/oauth/types/oidc.py @@ -67,7 +67,7 @@ class OpenIDConnectOAuth2Callback(OAuthCallback): client_class = OpenIDConnectClient 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()