Commit 1efeae1
fix: force AuthStyleInParams for Apple OAuth token exchange
Apple's /auth/token requires client_id and client_secret in the form
body (the client_secret is itself a JWT). go-oidc's Endpoint() leaves
AuthStyle as Unknown, which makes oauth2 probe AuthStyleInHeader first.
Apple rejects the Basic-auth attempt AND invalidates the authorization
code on that first call, so the subsequent AuthStyleInParams retry
fails with "invalid_grant".
Setting AuthStyleInParams on the endpoint skips the bad probe and goes
directly to the form-body mode Apple wants.
Also drop the long-standing oauth2.SetAuthURLParam("secret", ...) call:
Apple expects client_secret, not secret, and the oauth2 library now
adds the correct client_secret automatically when AuthStyleInParams is
set. The explicit client_id override is equally redundant.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent d02cbe3 commit 1efeae1
1 file changed
Lines changed: 9 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
105 | 112 | | |
106 | 113 | | |
107 | 114 | | |
108 | 115 | | |
109 | | - | |
| 116 | + | |
110 | 117 | | |
111 | 118 | | |
112 | 119 | | |
| |||
119 | 126 | | |
120 | 127 | | |
121 | 128 | | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
| 129 | + | |
128 | 130 | | |
129 | 131 | | |
130 | 132 | | |
| |||
0 commit comments