From 327df6529bb225b8efdea2dfebbe3b82f867d4e8 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Tue, 19 Jul 2022 16:41:10 +0000 Subject: [PATCH] sources/oauth: use oidc preferred_username if set, otherwise nickname --- 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 59ed16b08..336c4bc8c 100644 --- a/authentik/sources/oauth/types/oidc.py +++ b/authentik/sources/oauth/types/oidc.py @@ -27,7 +27,7 @@ class OpenIDConnectOAuth2Callback(OAuthCallback): info: dict[str, Any], ) -> dict[str, Any]: return { - "username": info.get("nickname"), + "username": info.get("nickname", info.get("prefered_username")), "email": info.get("email"), "name": info.get("name"), }