I can't log into my user account

Hello,

I’ve just installed Vaultwarden on Linux (Mageia 9) without docker after I’ve followed this post :

My config :

I can connect to the admin account and can create a user account but I can’t login using this new created account. I’m immediately disconnected. I’ve seen many topics with the same issue but without any clear explanation on how to solve it.
The error in the vaultwarden log file :
[2024-05-26 17:05:11.518][auth][ERROR] Unauthorized Error: No access token provided
[2024-05-26 17:05:11.518][vaultwarden::api::core::ciphers::_][WARN] Request guard Headers failed: “No access token provided”.

I’m using apache. Here is my vaultwarden.conf file :

<IfModule mod_proxy_http.c>

    SSLProxyEngine on
    ProxyRequests Off
    ProxyPreserveHost On

    <Proxy http://127.0.0.1:8000/vaultwarden/>
         Order allow,deny
         Allow from all
    </Proxy>

    ProxyPass /vaultwarden/ http://127.0.0.1:8000/vaultwarden/
    ProxyPassReverse /vaultwarden/ http://127.0.0.1:8000/vaultwarden/

#     ProxyPass /vaultwarden/ http://127.0.0.1:8000/vaultwarden/ upgrade=websocket

</IfModule>

Here is my config.json file :

{
  "domain": "https://my-domain.fr/vaultwarden",
  "sends_allowed": true,
  "incomplete_2fa_time_limit": 3,
  "disable_icon_download": false,
  "signups_allowed": true,
  "signups_verify": true,
  "signups_verify_resend_time": 3600,
  "signups_verify_resend_limit": 6,
  "org_creation_users": "xuo@my-domain.com",
  "invitations_allowed": true,
  "emergency_access_allowed": true,
  "email_change_allowed": true,
  "password_iterations": 600000,
  "password_hints_allowed": true,
  "show_password_hint": true,
  "admin_token": "$argon2id$this_is_my_admin_token",
  "invitation_org_name": "Vaultwarden",
  "ip_header": "X-Forwarded-For",
  "icon_redirect_code": 302,
  "icon_cache_ttl": 2592000,
  "icon_cache_negttl": 259200,
  "icon_download_timeout": 10,
  "icon_blacklist_non_global_ips": true,
  "disable_2fa_remember": false,
  "authenticator_disable_time_drift": false,
  "require_device_email": false,
  "reload_templates": false,
  "log_timestamp_format": "%Y-%m-%d %H:%M:%S.%3f",
  "admin_session_lifetime": 20,
  "_enable_yubico": true,
  "_enable_duo": true,
  "_enable_smtp": true,
  "use_sendmail": false,
  "smtp_host": "smtp.gmail.com",
  "smtp_security": "starttls",
  "smtp_port": 587,
  "smtp_from": "xuo@my-domain.com",
  "smtp_from_name": "Vaultwarden",
  "smtp_username": "xuo@my-domain.com",
  "smtp_password": "my-password",
  "smtp_timeout": 15,
  "smtp_embed_images": true,
  "smtp_accept_invalid_certs": false,
  "smtp_accept_invalid_hostnames": false,
  "_enable_email_2fa": true,
  "email_token_size": 6,
  "email_expiration_time": 600,
  "email_attempts_limit": 3
}

Could you help me to solve this issue ?

Regards.

Xuo.

Not sure if there should be a trailing slash in the DOMAIN variable or not. Our wiki seems to have contradictory opinions on the matter, e.g. Proxy examples seems to recommend it with but Using an alternate base dir does not. But my guess would be that this might be the cause of the problem.

From experience this also happens if you are using old rsa_key.* files, if you have upgraded from an old installation.

Hello stefan0xC,

Thank you for your answer but I don’t think it is the correct one :grinning:
In my .env file, I’ve got the /
DOMAIN=https://my-domain.fr/vaultwarden/
but it seems to be translated without in the file data/config.json :
“domain”: “https://my-domain.fr/vaultwarden”,

I didn’t try to overwrite what is written in the config.json file because I think it will be overridden again if I modify the .env file (am I right ?).

Regards.

xuo.

Hi,

When I’m logged onto my server and connect using :
http://127.0.0.1:8000/vaultwarden
then it works fine.
If I try using :
http://192.168.0.14/vaultwarden
then I get :
Vaultwarden
(192.168.0.14 is the local address of my server).
If I try using :
http://192.168.0.14:8000/vaultwarden
then it fails.
And again, if I try using :
https://my-domain.fr/vaultwarden/
it fails.

If it can give you any idea about the issue …

Regards.

Xuo.

I’ve forgotten to add some pictures.
http://192.168.0.14/vaultwarden
ksnip_20240817-161734
http://192.168.0.14:8000/vaultwarden

Hello,

I come back to this issue as I didn’t progress on it.
I’ve set the debug mode in the .env file to give more informations. Hope this can help.

Summary

[2024-12-01 14:37:57.318][request][INFO] GET /vaultwarden/
[2024-12-01 14:37:57.318][response][INFO] (web_index) GET /vaultwarden/ => 200 OK
[2024-12-01 14:37:57.940][request][INFO] GET /vaultwarden/images/apple-touch-icon.png
[2024-12-01 14:37:57.941][response][INFO] (web_files) GET /vaultwarden/<p…> [10] => 200 OK
[2024-12-01 14:37:58.044][request][INFO] GET /vaultwarden/api/config
[2024-12-01 14:37:58.044][response][INFO] (config) GET /vaultwarden/api/config => 200 OK
[2024-12-01 14:38:07.060][request][INFO] GET /vaultwarden/api/devices/knowndevice
[2024-12-01 14:38:07.062][response][INFO] (get_known_device) GET /vaultwarden/api/devices/knowndevice => 200 OK
[2024-12-01 14:38:09.027][request][INFO] POST /vaultwarden/identity/accounts/prelogin
[2024-12-01 14:38:09.028][response][INFO] (prelogin) POST /vaultwarden/identity/accounts/prelogin => 200 OK
[2024-12-01 14:38:10.124][request][INFO] POST /vaultwarden/identity/connect/token
[2024-12-01 14:38:10.562][vaultwarden::api::identity][INFO] User <my_email_address> logged in successfully. IP: 192.168.0.254
[2024-12-01 14:38:10.563][response][INFO] (login) POST /vaultwarden/identity/connect/token => 200 OK
[2024-12-01 14:38:10.587][request][INFO] GET /vaultwarden/api/config
[2024-12-01 14:38:10.587][response][INFO] (config) GET /vaultwarden/api/config => 200 OK
[2024-12-01 14:38:10.697][request][INFO] GET /vaultwarden/images/icon-white.png
[2024-12-01 14:38:10.698][response][INFO] (web_files) GET /vaultwarden/<p…> [10] => 200 OK
[2024-12-01 14:38:10.703][request][INFO] GET /vaultwarden/fonts/Open_Sans-normal-700.a39de6b1b80c7f21cf88.woff
[2024-12-01 14:38:10.703][response][INFO] (web_files) GET /vaultwarden/<p…> [10] => 200 OK
[2024-12-01 14:38:10.722][request][INFO] POST /vaultwarden/identity/connect/token
[2024-12-01 14:38:10.725][response][INFO] (login) POST /vaultwarden/identity/connect/token => 200 OK
[2024-12-01 14:38:10.849][request][INFO] GET /vaultwarden/api/sync?excludeDomains=true
[2024-12-01 14:38:10.850][auth][ERROR] Unauthorized Error: No access token provided
[2024-12-01 14:38:10.850][vaultwarden::api::core::ciphers::][WARN] Request guard Headers failed: “No access token provided”.
[2024-12-01 14:38:10.850][rocket::server::
][WARN] No 401 catcher registered. Using Rocket default.
[2024-12-01 14:38:10.850][response][INFO] (sync) GET /vaultwarden/api/sync?<data…> => 401 Unauthorized
[2024-12-01 14:38:10.866][request][INFO] GET /vaultwarden/notifications/hub/?access_token=eyJ0eXAiOiJKV1QiL
[2024-12-01 14:38:10.866][vaultwarden::api::notifications][INFO] Accepting Rocket WS connection from 192.168.0.254
[2024-12-01 14:38:10.866][response][INFO] (websockets_hub) GET /vaultwarden/notifications/hub?<data…> => 200 OK

I add my latest apache config as well. In fact, whatever this config is, if I can get the login screen, the error is the same :
[2024-12-01 14:38:10.850][auth][ERROR] Unauthorized Error: No access token provided
[2024-12-01 14:38:10.850][vaultwarden::api::core::ciphers::_][WARN] Request guard Headers failed: “No access token provided”.

and I get logged out immediately.

Summary

<IfModule mod_proxy_http.c>
SSLProxyEngine on
ProxyPreserveHost On
<Location /vaultwarden/>
RewriteEngine On
ProxyPass http://127.0.0.1:8000/vaultwarden/
</Location>
</IfModule>

Thank you for your help.

regards.

Xuo.