You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(fe): label SSO credentials by discovery domain, not IdP issuer
An SSO-linked access method (e.g. via `dfinity.org`'s Okta) was being
rendered as "Google account" with the Google logo because
`findConfig(iss, metadata)` matched on issuer alone. When the
underlying IdP happens to be Google, the credential's `iss` is the
Google issuer and collides with the direct "Sign in with Google"
entry in `openid_configs` — even though the `aud` (client_id) is
completely different.
Changes:
- `findConfig(iss, aud, metadata)` now matches on both `iss` and `aud`
(the OAuth client_id). `aud` is accepted as `string | undefined`;
callers that haven't been extended to track `aud` yet
(`LastUsedIdentity`-based paths — see dfinity#3795) keep their issuer-only
behavior for now, which is correct for direct providers and
mis-attributes SSO credentials at those legacy sites only.
- `openIdName(iss, sub, aud, metadata)` now also consults a per-device
localStorage map (`ssoDomainStorage.ts`) populated at SSO link time.
If the credential was linked via SSO on this device, the label
becomes the `discovery_domain` the user typed (e.g. "dfinity.org
account").
- `openIdLogo(iss, aud, metadata)` returns `undefined` for credentials
that don't match any direct provider — the access-methods UI uses
the generic SSO key icon as a fallback in that case.
- `SsoDiscoveryResult` grows a `domain` field; both sign-in and
add-access-method flows persist the `(iss, sub, aud) → domain`
mapping after a successful SSO link, so the next render shows the
correct label.
- `OpenIdItem` renders the `<SsoIcon>` when `openIdLogo` returns
undefined, and falls back to the literal "SSO" word when no domain
is stored (cross-device case).
Cross-device labelling (credential linked on device A, viewed on
device B) remains wrong until the `discovery_domain` is persisted on
the backend credential — tracked in dfinity#3795.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments