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

Regex for sub claim doesn't allow localhost #551

Closed
jaxoncreed opened this issue Nov 5, 2020 · 1 comment · Fixed by #578
Closed

Regex for sub claim doesn't allow localhost #551

jaxoncreed opened this issue Nov 5, 2020 · 1 comment · Fixed by #578
Labels
bug Something isn't working

Comments

@jaxoncreed
Copy link
Contributor

The regex here (

if (!decoded.sub.match(/^https?:\/\/.+\..+$/)) {
) doesn't allow for a domain like https://localhost:8443/profile/card#me. Because NSS does not issue a webid claim, a user running NSS on single-user mode locally is not able to log in.

@nicolasmondada
Copy link
Contributor

Good catch! Thanks for reporting this @jaxoncreed.

NSeydoux added a commit that referenced this issue Nov 10, 2020
Resolves #551.

Instead of parsing the `sub` claim with a regex, this uses a proper IRI parser to validate that the sub is well-formed to derive a webid. In particular, local IRI from test NSS instances are now accepted.
NSeydoux added a commit that referenced this issue Nov 10, 2020
Resolves #551.

Instead of parsing the `sub` claim with a regex, this uses a proper IRI parser to validate that the sub is well-formed to derive a webid. In particular, local IRI from test NSS instances are now accepted.

Co-authored-by: Vincent <Vinnl@users.noreply.github.com>
Co-authored-by: Pat McBennett <patm@inrupt.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants