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

Fix public api for domains with path prefix #4500

Merged
merged 1 commit into from May 19, 2024

Conversation

FDHoho007
Copy link
Contributor

Vaultwarden is currently unable to handle the Bitwarden Directory Connector when the base domain includes a path prefix.
Example:
DOMAIN=https://example.com/ -> works
DOMAIN=https://example.com/vault/ -> doesn't work
Vaultwarden rejects the token issued seconds before with the error message "Token not issued by this server".
This message is thrown when the token issuer check fails. When a organization api token is issued, the iss attribute follows the scheme "domain_origin|scope". But when the issuer is checked in api/core/public.rs, the iss attribute is expected to contain "domain|scope".
When using a domain with path prefix this leads to conflicts. To fix this I replaced the domain check through a domain_origin check as issued in auth.rs.

@BlackDex
Copy link
Collaborator

@FDHoho007 Thanks for the PR :).
Good find!

@dani-garcia dani-garcia merged commit 753a9e0 into dani-garcia:main May 19, 2024
5 checks passed
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 this pull request may close these issues.

None yet

3 participants