Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid well-known URL generated when issuer has trailing Slash #217

Open
BeryJu opened this issue Oct 7, 2022 · 0 comments
Open

Invalid well-known URL generated when issuer has trailing Slash #217

BeryJu opened this issue Oct 7, 2022 · 0 comments

Comments

@BeryJu
Copy link

BeryJu commented Oct 7, 2022

Expected Behavior

(Originating from netbirdio/netbird#452)

authentik (goauthentik.io) has an issuer with a trailing slash, which causes issues with this function

const fullUrl = `${openIdIssuerUrl}/${WELL_KNOWN_PATH}/${OPENID_CONFIGURATION}`;
,

as it'll generate a URL like https://id.beryju.org/application/o/netbird//.well-known/openid-configuration (notice the double slash)

[REQUIRED] Describe expected behavior

The function should check if the issuer has a trailing slash and not append an extra one. I'm not sure if there are any native JavaScript ways to merge URL paths

Describe the problem

[REQUIRED] Actual Behavior

Because of the double-slash, the request fails

[REQUIRED] Steps to reproduce the behavior

Use this Library with any OpenID Connect provider that uses trailing slashes in their issue (for example authentik)

[REQUIRED] Environment

  • AppAuth-JS version: 1.3.1
  • AppAuth-JS Environment (Node, Browser (UserAgent), ...): 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36'
  • Source code snippts (inline or JSBin) N/A
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant