mirror of
https://github.com/theonedev/onedev.git
synced 2025-12-08 18:26:30 +00:00
feat: Accept email as verified if verified_email claim is not present in OIDC provider (OD-2573)
This commit is contained in:
parent
2f0311fe8a
commit
16a4178fef
@ -118,7 +118,7 @@ public class DiscordConnector extends SsoConnector {
|
||||
String userName = (String) userObject.get("username");
|
||||
String email = StringUtils.trimToNull((String) userObject.get("email"));
|
||||
Boolean verified = (Boolean) userObject.get("verified");
|
||||
if (!Boolean.TRUE.equals(verified))
|
||||
if (verified != null && !verified)
|
||||
email = null;
|
||||
|
||||
if (bCheckGuilds) {
|
||||
|
||||
@ -225,10 +225,11 @@ public class OpenIdConnector extends SsoConnector {
|
||||
|
||||
String subject = claims.getSubject();
|
||||
String email = StringUtils.trimToNull(claims.getStringClaim("email"));
|
||||
|
||||
Boolean emailVerified = claims.getBooleanClaim("email_verified");
|
||||
if (emailVerified == null)
|
||||
emailVerified = claims.getBooleanClaim("emailVerified");
|
||||
if (!Boolean.TRUE.equals(emailVerified))
|
||||
if (emailVerified != null && !emailVerified)
|
||||
email = null;
|
||||
|
||||
String userName = StringUtils.trimToNull(claims.getStringClaim("preferred_username"));
|
||||
@ -264,7 +265,7 @@ public class OpenIdConnector extends SsoConnector {
|
||||
emailVerified = getBooleanValue(json.get("email_verified"));
|
||||
if (emailVerified == null)
|
||||
emailVerified = getBooleanValue(json.get("emailVerified"));
|
||||
if (!Boolean.TRUE.equals(emailVerified))
|
||||
if (emailVerified != null && !emailVerified)
|
||||
email = null;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user