Commit 0e99155
committed
Replace People API user lookup with OIDC userinfo endpoint
Joe says:
OK I'm going to count this as a win for Claude. It has always bothered me that
we added a whole OAuth scope just so we could say “programming as joe.politz”
in the bottom left, when *we just logged the user in with that email address*.
I just never found the API to do it.
Turns out this does come for free with OpenID Connect. This change removes an
entire scope *and* makes it so we can disable an API in the cloud console.
Claude says:
The four call sites that fetched the user's email via People API
(people/v1, api.people.get) only ever used the email address — the
display name was always overwritten. Switch to the OIDC userinfo
endpoint, which returns the email with just the `email` scope.
- Drop `profile` from DEFAULT_OAUTH_SCOPES and FULL_OAUTH_SCOPES
- Replace gwrap.load({name: 'people'}) + api.people.get with a
fetch to https://openidconnect.googleapis.com/v1/userinfo
- Update StudentDashboard to read `.email` instead of
`.emailAddresses[0].value`
Consent screen no longer says "Email and profile photo", and the
People API no longer needs to be enabled in the Cloud project.1 parent 0f43b2c commit 0e99155
5 files changed
Lines changed: 19 additions & 29 deletions
File tree
- src
- web/js
- dashboard
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | 7 | | |
9 | 8 | | |
10 | 9 | | |
11 | 10 | | |
12 | 11 | | |
13 | 12 | | |
14 | | - | |
15 | 13 | | |
16 | 14 | | |
17 | 15 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
305 | 305 | | |
306 | 306 | | |
307 | 307 | | |
308 | | - | |
309 | | - | |
310 | | - | |
311 | | - | |
312 | | - | |
313 | | - | |
314 | | - | |
315 | | - | |
316 | | - | |
317 | | - | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
318 | 315 | | |
319 | 316 | | |
320 | 317 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
457 | 457 | | |
458 | 458 | | |
459 | 459 | | |
460 | | - | |
461 | | - | |
462 | | - | |
463 | | - | |
464 | | - | |
465 | | - | |
466 | | - | |
467 | | - | |
468 | | - | |
469 | | - | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
470 | 467 | | |
471 | 468 | | |
472 | 469 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
160 | 158 | | |
161 | 159 | | |
162 | 160 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| |||
0 commit comments