Skip to content

Commit 75e69b9

Browse files
login: discover IdP via bare oidcIssuer term (sso#1 fix)
JSS profiles declare the OIDC issuer using the bare term `oidcIssuer` (aliased to solid:oidcIssuer in @context). My discoverIdpFromWebId() only looked for the prefixed form (`solid:oidcIssuer`), so the field was never found on JSS profiles, the fallback to `new URL(webId).origin` fired, and solid-oidc raised "Issuer mismatch" — the WebID's origin (test.solid.social) doesn't match the openid-config issuer (solid.social/) that test.solid.social returns from its own .well-known/openid-configuration. Now reads `profile.oidcIssuer` first, falling back to the prefixed / full-URI forms for profiles emitted by other servers that don't alias the term.
1 parent 8f4b305 commit 75e69b9

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

login.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,12 @@ async function discoverIdpFromWebId(webId) {
110110
});
111111
if (profileRes.ok) {
112112
const profile = await profileRes.json();
113-
const issuer = profile['solid:oidcIssuer']
113+
// JSS profiles declare the IdP via the bare term `oidcIssuer`
114+
// (aliased to solid:oidcIssuer in @context). Try the bare form
115+
// FIRST, then the prefixed / full-URI forms as fallbacks for
116+
// profiles emitted by other servers.
117+
const issuer = profile.oidcIssuer
118+
|| profile['solid:oidcIssuer']
114119
|| profile['http://www.w3.org/ns/solid/terms#oidcIssuer']
115120
|| profile.solid?.oidcIssuer;
116121
const issuerStr = typeof issuer === 'string'

0 commit comments

Comments
 (0)