Skip to content

Commit 23d69f1

Browse files
authored
fix: new odic.Provider for apple with insecure issuer url context (#2055)
Apple's ID tokens sometimes say `https://appleid.apple.com` but the well-known URL returns that the issuer should be `https://account.apple.com`.
1 parent 1c6f18e commit 23d69f1

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

internal/api/token_oidc.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,12 @@ func (p *IdTokenGrantParams) getProvider(ctx context.Context, config *conf.Globa
127127
return nil, false, "", nil, apierrors.NewBadRequestError(apierrors.ErrorCodeProviderDisabled, fmt.Sprintf("Provider (issuer %q) is not enabled", issuer))
128128
}
129129

130-
oidcProvider, err := oidc.NewProvider(ctx, issuer)
130+
oidcCtx := ctx
131+
if providerType == "apple" {
132+
oidcCtx = oidc.InsecureIssuerURLContext(ctx, issuer)
133+
}
134+
135+
oidcProvider, err := oidc.NewProvider(oidcCtx, issuer)
131136
if err != nil {
132137
return nil, false, "", nil, err
133138
}

0 commit comments

Comments
 (0)