Skip to content

Commit e84a566

Browse files
hfissuedat
authored andcommitted
fix: skip apple oidc issuer check (#2053)
Defers issuer check.
1 parent 8b5ef9d commit e84a566

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

internal/api/provider/apple.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,8 @@ func (p AppleProvider) GetUserData(ctx context.Context, tok *oauth2.Token) (*Use
148148
}
149149

150150
_, data, err := ParseIDToken(ctx, p.oidc, &oidc.Config{
151-
ClientID: p.ClientID,
151+
ClientID: p.ClientID,
152+
SkipIssuerCheck: true,
152153
}, idToken.(string), ParseIDTokenOptions{
153154
AccessToken: tok.AccessToken,
154155
})

internal/api/token_oidc.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,16 @@ func (a *API) IdTokenGrant(ctx context.Context, w http.ResponseWriter, r *http.R
160160
return err
161161
}
162162

163-
idToken, userData, err := provider.ParseIDToken(ctx, oidcProvider, nil, params.IdToken, provider.ParseIDTokenOptions{
163+
var oidcConfig *oidc.Config
164+
165+
if providerType == "apple" {
166+
oidcConfig = &oidc.Config{
167+
SkipClientIDCheck: true,
168+
SkipIssuerCheck: true,
169+
}
170+
}
171+
172+
idToken, userData, err := provider.ParseIDToken(ctx, oidcProvider, oidcConfig, params.IdToken, provider.ParseIDTokenOptions{
164173
SkipAccessTokenCheck: params.AccessToken == "",
165174
AccessToken: params.AccessToken,
166175
})

0 commit comments

Comments
 (0)