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

Bug: Domain only validation doesn't work for custom schemes #200

Closed
wilwade opened this issue Oct 22, 2024 · 0 comments · Fixed by #205
Closed

Bug: Domain only validation doesn't work for custom schemes #200

wilwade opened this issue Oct 22, 2024 · 0 comments · Fixed by #205
Assignees

Comments

@wilwade
Copy link
Contributor

wilwade commented Oct 22, 2024

If an application is using a custom scheme (such as for a desktop or mobile application), then just validation of the login domain is not enough.

The Library should instead, validate the URI using this set of rules:

  • If the passed in value has a scheme, the scheme must match
  • If the passed in value has a path, the path must match, although NOT the query values
  • The domain must always match BOTH the URI and the domain values
  • Should NOT validate ports

Fix: https://github.com/ProjectLibertyLabs/siwf/blob/main/libraries/js/src/mocks/payloads.ts#L16 should use a passed in URI instead of a static value.

Should Work Examples:

  • https://www.example.com/login Validate https, www.example.com and /login
  • example://login Validate example, login, and Ignore path
  • www.example.com/login Validate www.example.com and /login and Ignore scheme
  • localhost:3030/login/path Validate localhost domain and /login/path path. Ignore the port
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.

2 participants