瀏覽代碼

feat: remove custom hardcoded OIDC challenge for Google

beltram 3 年之前
父節點
當前提交
6ffd913e28
共有 1 個文件被更改,包括 2 次插入 和 11 次删除
  1. 2 11
      acme/challenge.go

+ 2 - 11
acme/challenge.go

@@ -411,17 +411,8 @@ func wireOIDC01Validate(ctx context.Context, ch *Challenge, db DB, jwk *jose.JSO
 			"keyAuthorization does not match; expected %s, but got %s", expectedKeyAuth, wireChallengePayload.KeyAuth))
 	}
 
-	if claims.Issuer == "https://accounts.google.com" {
-		// for internal demo purpose only
-		var handle = fmt.Sprintf("im:wireapp=%s_wire", strings.ToLower(claims.GivenName))
-		var displayName = claims.Handle
-		if challengeValues.Name != displayName || challengeValues.Handle != handle {
-			return storeError(ctx, db, ch, false, NewError(ErrorRejectedIdentifierType, "OIDC claims don't match"))
-		}
-	} else {
-		if challengeValues.Name != claims.Name || challengeValues.Handle != claims.Handle {
-			return storeError(ctx, db, ch, false, NewError(ErrorRejectedIdentifierType, "OIDC claims don't match"))
-		}
+	if challengeValues.Name != claims.Name || challengeValues.Handle != claims.Handle {
+		return storeError(ctx, db, ch, false, NewError(ErrorRejectedIdentifierType, "OIDC claims don't match"))
 	}
 
 	// Update and store the challenge.