Skip to content

Bug: WebID profile discovery fails when server returns HTML instead of Turtle #79

@melvincarvalho

Description

@melvincarvalho

Bug description:

When fetching a WebID profile for OIDC issuer discovery, the rdflib fetcher doesn't send an Accept header preferring RDF formats. If the server returns HTML (with embedded JSON-LD) instead of Turtle, the solid:oidcIssuer is not discovered and authentication fails.

Steps to reproduce:

  1. Have a WebID profile that returns HTML by default (with JSON-LD) but Turtle when requested
  2. Ensure solid:oidcIssuer is set in the Turtle representation
  3. Try to authenticate to NSS using a token from that IdP
  4. Authentication fails with "OIDC issuer not advertised"

Cause:

In preferred-provider.js, fetcher.load(webId, { force: true }) doesn't specify an Accept header. The server returns HTML, and rdflib fails to resolve relative URIs like @id: "#me" in the embedded JSON-LD.

Suggested fix:

const options = {
  force: true,
  headers: { 'Accept': 'text/turtle, application/ld+json, text/n3, application/rdf+xml' }
}
return fetcher.load(webId, options)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions