Timshel/vaultwarden

Redirection issue when in a subpath

Thechi2000 opened this issue · 2 comments

Hi,

I've been trying out this version a bit, but I've encountered a critical issue:

When the service is in a subpath (e.g. /vaultwarden), at the end of the OIDC flow, the user gets redirected to /#/sso?code=... instead of /vaultwarden/#/sso?code=.... I haven't found a relevant configuration option.

From what I was able to figure out, the issue seems to occur after the redirect from the OIDC provider. The user is redirected to /vaultwarden/identity/connect/oidc-signin, then to /vaultwarden/sso-connector.html, which then loads a script /vaultwarden/sso.<random hex>.js redirecting to /#/sso?code=.... I haven't been able to understand any further.

My config:

DOMAIN: https://example.com/vaultwarden
ADMIN_TOKEN: ${ADMIN_TOKEN}

SSO_ENABLED: "true"
SSO_FRONTEND: button
SSO_CLIENT_ID: vaultwarden
SSO_CLIENT_SECRET: ${KEYCLOAK_SECRET}
SSO_AUTHORITY: https://example.com/keycloak/realms/master
      
SSO_ORGANIZATIONS_INVITE: "true"
SSO_ORGANIZATIONS_ID_MAPPING: "<mapping>"

Hey,

I can reproduce the issue.
I believe it's coming from logic in the bitwarden web app.

Will try to make a patch and might even try to push it upstream but in the meantime would recommend not to try to use a subpath.

Hey
Pushed a new version to testing which should fix the issue.
It's still building so will probably take 30min more.