# Admin token invalid

**URL:** <https://vaultwarden.discourse.group/t/admin-token-invalid/2681>\
**Category:** Help\
**Created:** [May 20, 2023, 9:10am UTC](https://vaultwarden.discourse.group/t/admin-token-invalid/2681 "2023-05-20T09:10:41Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![moonrise](https://yyz2.discourse-cdn.com/free1/user_avatar/vaultwarden.discourse.group/moonrise/32/1097_2.png) [@moonrise](https://vaultwarden.discourse.group/u/moonrise)\
**Post date:** [May 20, 2023, 9:10am UTC](https://vaultwarden.discourse.group/t/admin-token-invalid/2681/1 "2023-05-20T09:10:41Z")

</div>

I’m using the Container Manager of DSM 7.2 to build a Vaultwarden instance on my Synology DS. It works until I want to login into the admin site. In the log I see the notice:

```auto
[NOTICE] You are using a plain text `ADMIN_TOKEN` which is insecure.

```

And when I type in my token (why is it called that and not passphrase or something?) I get the message “Error: Invalid admin token, please try again.”

Even though I used the recommended way to create that ADMIN\_TOKEN. I tried putting it between ’ and ’ I tried with additional $ but nothing worked. I even removed spaces in the token. There is also no config.json in the vaultwarden folder.

---

<div class="post-metadata">

**Author:** ![BlackDex](https://yyz2.discourse-cdn.com/free1/user_avatar/vaultwarden.discourse.group/blackdex/32/8_2.png) [@BlackDex](https://vaultwarden.discourse.group/u/BlackDex)\
**Post date:** [May 20, 2023, 10:30am UTC](https://vaultwarden.discourse.group/t/admin-token-invalid/2681/2 "2023-05-20T10:30:06Z")

</div>

I don’t know how DSM works, but did you redeploy’d the container? Because restarting doesn’t work.

---

<div class="post-metadata">

**Author:** ![moonrise](https://yyz2.discourse-cdn.com/free1/user_avatar/vaultwarden.discourse.group/moonrise/32/1097_2.png) [@moonrise](https://vaultwarden.discourse.group/u/moonrise)\
**Post date:** [May 20, 2023, 11:18am UTC](https://vaultwarden.discourse.group/t/admin-token-invalid/2681/3 "2023-05-20T11:18:27Z")

</div>

Okay, by completely redeploying the container I got rid of the plain text token warning in the log. But it still says, token invalid when I try to log in.

My compose.yml is currently looks like this.

```auto
version: '3'
services:
  vaultwarden:
    container_name: vaultwarden
    image: vaultwarden/server:latest
    restart: unless-stopped
    volumes:
      - /volume1/docker/vaultwarden:/data/
    ports:
      - 3012:3012
      - 8122:80
    environment:
      DOMAIN: "https://"
      LOGIN_RATELIMIT_MAX_BURST: 10
      LOGIN_RATELIMIT_SECONDS: 60
      ADMIN_RATELIMIT_MAX_BURST: 10
      ADMIN_RATELIMIT_SECONDS: 60
      ADMIN_TOKEN: "$$argon2id$$v=19$$m=19456,t=2,p=$$"
      SENDS_ALLOWED: true
      EMERGENCY_ACCESS_ALLOWED: true
      WEB_VAULT_ENABLED: true
      SIGNUPS_ALLOWED: false
      SIGNUPS_VERIFY: true
      SIGNUPS_VERIFY_RESEND_TIME: 3600
      SIGNUPS_VERIFY_RESEND_LIMIT: 5
      SMTP_HOST: 
      SMTP_FROM: 
      SMTP_FROM_NAME: Vaultwarden
      SMTP_SECURITY: force_tls
      SMTP_PORT: 465
      SMTP_USERNAME: 
      SMTP_PASSWORD: 
      SMTP_AUTH_MECHANISM: "Plain"

```

---

<div class="post-metadata">

**Author:** ![BlackDex](https://yyz2.discourse-cdn.com/free1/user_avatar/vaultwarden.discourse.group/blackdex/32/8_2.png) [@BlackDex](https://vaultwarden.discourse.group/u/BlackDex)\
**Post date:** [May 20, 2023, 11:31am UTC](https://vaultwarden.discourse.group/t/admin-token-invalid/2681/4 "2023-05-20T11:31:50Z")

</div>

How did you generated the token/hash?

---

<div class="post-metadata">

**Author:** ![moonrise](https://yyz2.discourse-cdn.com/free1/user_avatar/vaultwarden.discourse.group/moonrise/32/1097_2.png) [@moonrise](https://vaultwarden.discourse.group/u/moonrise)\
**Post date:** [May 20, 2023, 11:34am UTC](https://vaultwarden.discourse.group/t/admin-token-invalid/2681/5 "2023-05-20T11:34:00Z")

</div>

I used this command:

```auto
echo -n "very secure and long password" | argon2 "$(openssl rand -base64 32)" -e -id -k 19456 -t 2 -p 1

```

---

<div class="post-metadata">

**Author:** ![moonrise](https://yyz2.discourse-cdn.com/free1/user_avatar/vaultwarden.discourse.group/moonrise/32/1097_2.png) [@moonrise](https://vaultwarden.discourse.group/u/moonrise)\
**Post date:** [May 20, 2023, 11:47am UTC](https://vaultwarden.discourse.group/t/admin-token-invalid/2681/6 "2023-05-20T11:47:23Z")

</div>

I redid that and included the sed command to add the $$, before I did that in an editor manually. Maybe that did something which shouldn’t happened. Now it works.

---

<div class="post-metadata">

**Author:** ![BlackDex](https://yyz2.discourse-cdn.com/free1/user_avatar/vaultwarden.discourse.group/blackdex/32/8_2.png) [@BlackDex](https://vaultwarden.discourse.group/u/BlackDex)\
**Post date:** [May 20, 2023, 11:49am UTC](https://vaultwarden.discourse.group/t/admin-token-invalid/2681/7 "2023-05-20T11:49:29Z")

</div>

Good to hear! Thanks for mentioning.
