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
@ -5,7 +5,7 @@ import io.onedev.commons.utils.ExplicitException;
|
||||
public class PullRequestReviewRejectedException extends ExplicitException {
|
||||
|
||||
public PullRequestReviewRejectedException(String message) {
|
||||
super(message);
|
||||
super(message);
|
||||
}
|
||||
|
||||
}
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -335,7 +336,7 @@ public class OpenIdConnector extends SsoConnector {
|
||||
public void setRequestScopes(String requestScopes) {
|
||||
this.requestScopes = requestScopes;
|
||||
}
|
||||
|
||||
|
||||
@Editable(order=10100, group = "More Settings", description="Optionally specify the OpenID claim to retrieve " +
|
||||
"groups of authenticated user. Depending on the provider, you may need to request additional scopes " +
|
||||
"above to make this claim available")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user