Session expired when using basicauth

1. Caddy version (caddy version):


2. How I run Caddy:

As per caddy instructions.

a. System environment:

Ubuntu 20.04LTS on rPi 4

b. Command:

sudo systemctl start caddy.service

c. Service/unit/compose file:


d. My complete Caddyfile or JSON config: {
  log {
    level INFO
    output file /home/ubuntu/caddy.log {
      roll_size 10MB
      roll_keep 10
  encode gzip
  reverse_proxy localhost:8080

  basicauth * {
    userName xQDBBfDxxxdxxxxxxxtswfhsfdhdfxxxxxxxxxxYYASDxxxxxxxdgfhjdfghsf

3. The problem I’m having:

I’ve got my bitwardenrs instance running and thought it’d be good to provide some layers of protection. Especially after seeing this.

I tried setting basicauth in caddy, which is fine for my initial url, but as soon as I try to login (e.g., it immediately logs me out. Actually, it very briefly (milliseconds) flashes the /vault/ but then logs out and errors.

I’ve used the * wildcard in the caddy basicauth directive, which I would’ve thought that would allow full access everywhere, but I guess that’s not quite right.

Any ideas?


4. Error messages and/or full log output:

Logged out
Your login session has expired

5. What I already tried:

Duplicated the basicauth directive for the relevant areas within bitwarden e.g. /vault/ etc. but the ‘session expired’ problem persists.

Doesn’t your bitwarden instance have its own authentication? It doesn’t make sense to double up if that’s the case.

True, but I just wanted to deter unwanted visitors.

However, if it can’t be done, then so be it.

This topic was automatically closed after 30 days. New replies are no longer allowed.