dockercouchdbdigital-ocean

CouchDB Fauxton login not working on DigitalOcean Docker APP


I've deployed the vanilla CouchDB Docker container, tag "latest" on DigitalOcean's App Platform.

I set the admin user using environment variables and I successfully were able to curl to the database server on https port 443, not 5984 as a raw install. Then I created the system databases as outlined in the docker documentation.

The initial load of the Fauxton UI worked (using _utils), however login fails on an UI level. The login form submits the form with name/password, CouchDB replies with:

{
  "ok":true,
  "name":"couchadmin",
  "roles":[
             "_admin"
          ] 
}

A toast appears "You have been logged in", the AuthSession cookies gets set, but Fauxton won't let me access any function, just redirects to the login page again.

What do I miss?

Update

Checked the network tab again, there's more going on:

{"ok":true,"userCtx":{"name":null,"roles":[]},"info":{"authentication_handlers":["cookie","default"]}}

name and roles are null/empty. Then GET repeats a final time with the same result

** Update 2 **

When I query _session?basic=true I get a proper response:

{
  ok: true,
  userCtx: {
    name: "couchadmin",
    roles: [
      "_admin",
      "user",
      "admin"
    ]
  },
  info: {
    authentication_handlers: [
      "cookie",
      "default"
    ],
    authenticated: "cookie"
  }
}

Solution

  • Looks like the session cookie is eaten somewhere along the line.

    In your first POST to _SESSION, can you check what response headers you get and whether it includes a session cookie?