Skip to content

Default #getIssuer in DPoPTokenProvider should not hard-code IDPs based on request URLs #4

@jeswr

Description

@jeswr

I would suggest having no default at all, and making #getIssuer a callback parameter. If there is a default I would make it based on user-interaction with a pop-up.

async #getIssuer(request: Request): Promise<URL> {
if (request.url.includes(".solidcommunity.net")) {
return new URL("https://solidcommunity.net")
} else if (request.url.includes("datapod.igrant.io")) {
return new URL("https://datapod.igrant.io")
} else if (request.url.includes(".solidweb.app")) {
return new URL("https://solidweb.app")
} else if (request.url.includes("storage.inrupt.com")) {
return new URL("https://login.inrupt.com")
} else if (request.url.includes("teamid.live")) {
return new URL("https://teamid.live")
} else if (request.url.includes(".solidweb.org")) {
return new URL("https://solidweb.org")
} else if (request.url.includes("localhost:3000")) {
return new URL("http://localhost:3000")
} else {
throw new Error(`Unknown issuer ${request.url}`)
}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions