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"), }