openid / openid/AppAuth-JS

Invalid well-known URL generated when issuer has trailing Slash

Open
#217 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
1k
Forks
165
PR merge metrics
No merged PRs in 30d

Description

Expected Behavior

(Originating from https://github.com/netbirdio/netbird/issues/452)

authentik (goauthentik.io) has an issuer with a trailing slash, which causes issues with this function https://github.com/openid/AppAuth-JS/blob/cf6bb68dfe630c5d5f415bdcc76ea2581f041d8f/src/authorization_service_configuration.ts#L73,

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/authorization_service_configuration.ts at the well-known URL construction referenced by the issue. Reproduce the case with an issuer ending in a slash, then verify the generated OpenID configuration URL contains only one separator and that existing issuer URLs continue to work.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
authentication
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.