Update providerId to fallback to id in the absence of a sub field. (#5343)

This commit is contained in:
DandrewsDev
2023-05-18 09:09:08 -04:00
committed by GitHub
parent 1e50facd5d
commit dca64fe84b

View File

@@ -111,6 +111,7 @@ if (
// Default is 'preferred_username' as per OIDC spec.
const username = get(profile, env.OIDC_USERNAME_CLAIM);
const name = profile.name || username || profile.username;
const providerId = profile.sub ? profile.sub : profile.id;
if (!name) {
throw AuthenticationError(
@@ -137,7 +138,7 @@ if (
providerId: domain,
},
authentication: {
providerId: profile.sub,
providerId,
accessToken,
refreshToken,
expiresIn: params.expires_in,