[GH-ISSUE #425] can't login to admin panel after update #249

Closed
opened 2026-03-03 01:27:12 +03:00 by kerem · 4 comments
Owner

Originally created by @pdarcos on GitHub (Mar 6, 2019).
Original GitHub issue: https://github.com/dani-garcia/vaultwarden/issues/425

Hi,

I'm using your latest docker image and everything works fine except logging in to the admin panel.

I'm starting bitwarden with -e ADMIN_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

But when I go to my.site/admin and am presented with the login page, even though I copy/paste the token exactly as it is above (obviously not xxxxxxxxxxxxxxxxxxxxxxxxxx) I always get the
"error: Invalid admin token, please try again." error message.

looking through the logs I see

[2019-03-06 21:17:34][rocket::rocket][INFO] POST /admin application/x-www-form-urlencoded:
[2019-03-06 21:17:34][_][INFO] Matched: POST /admin (post_admin_login)
[2019-03-06 21:17:34][bitwarden_rs::api::admin][ERROR] Invalid admin token. IP: y.y.y.y

I'm certain the token is correct since it's the same one being set on the command line. I don't understand why it thinks its invalid. Did you change anything on the admin authentication?

Thanks

Originally created by @pdarcos on GitHub (Mar 6, 2019). Original GitHub issue: https://github.com/dani-garcia/vaultwarden/issues/425 Hi, I'm using your latest docker image and everything works fine except logging in to the admin panel. I'm starting bitwarden with -e ADMIN_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx But when I go to my.site/admin and am presented with the login page, even though I copy/paste the token exactly as it is above (obviously not xxxxxxxxxxxxxxxxxxxxxxxxxx) I always get the "error: Invalid admin token, please try again." error message. looking through the logs I see [2019-03-06 21:17:34][rocket::rocket][INFO] POST /admin application/x-www-form-urlencoded: [2019-03-06 21:17:34][_][INFO] Matched: POST /admin (post_admin_login) [2019-03-06 21:17:34][bitwarden_rs::api::admin][ERROR] Invalid admin token. IP: y.y.y.y I'm certain the token is correct since it's the same one being set on the command line. I don't understand why it thinks its invalid. Did you change anything on the admin authentication? Thanks
kerem closed this issue 2026-03-03 01:27:12 +03:00
Author
Owner

@dani-garcia commented on GitHub (Mar 6, 2019):

I'm not sure why it would stop working now. Can you make sure that you aren't copying any extra characters when pasting the token? Is there any weird character that might be breaking the command line parsing or something?

<!-- gh-comment-id:470289362 --> @dani-garcia commented on GitHub (Mar 6, 2019): I'm not sure why it would stop working now. Can you make sure that you aren't copying any extra characters when pasting the token? Is there any weird character that might be breaking the command line parsing or something?
Author
Owner

@pdarcos commented on GitHub (Mar 6, 2019):

That was my first thought too but unfortunately it's not that easy.

I've even tried with -e ADMIN_TOKEN=12345678 and manually entering 12345678 in the admin panel and I still get the invalid admin token message.

Could it be ignoring -e ADMIN_TOKEN=12345678 with docker run and getting the token from somewhere else? I did migrate the bw-data folder from my previous install - maybe the previous admin token is hardcoded in there somewhere?

<!-- gh-comment-id:470291342 --> @pdarcos commented on GitHub (Mar 6, 2019): That was my first thought too but unfortunately it's not that easy. I've even tried with -e ADMIN_TOKEN=12345678 and manually entering 12345678 in the admin panel and I still get the invalid admin token message. Could it be ignoring -e ADMIN_TOKEN=12345678 with docker run and getting the token from somewhere else? I did migrate the bw-data folder from my previous install - maybe the previous admin token is hardcoded in there somewhere?
Author
Owner

@dani-garcia commented on GitHub (Mar 6, 2019):

If you ever edited the config options in the admin panel, then that should have saved the settings to bw-data/config.json, and that file overrides the environment variables, so it might be using an old value, yes.

<!-- gh-comment-id:470292285 --> @dani-garcia commented on GitHub (Mar 6, 2019): If you ever edited the config options in the admin panel, then that should have saved the settings to bw-data/config.json, and that file overrides the environment variables, so it might be using an old value, yes.
Author
Owner

@pdarcos commented on GitHub (Mar 6, 2019):

Aha, that was it.

Thanks!

<!-- gh-comment-id:470292792 --> @pdarcos commented on GitHub (Mar 6, 2019): Aha, that was it. Thanks!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/vaultwarden#249
No description provided.