Open nicfab opened 2 years ago
From https://github.com/bitwarden/server/issues/253#issuecomment-378105668 I discovered that I can access directly to https://yourdomain.com/admin/login
However, I hope that an update can fix it to access directly to https://yourdomain.com/admin according to the instructions published here https://bitwarden.com/help/admin-portal/#access-the-admin-portal
Hi @nicfab , thanks for bringing this to our attention. We will make time and take a look.
I think, it's aspnetcore related bug. Authentication middleware does not redirect correctly. If you remove [Authorize] attribute you'll see, it works clear. Some workarounds are available;
This approach should be managed by a config parameter or something.
app.Use((context, next) =>
{
context.Request.Scheme = "https";
return next(context);
});
This is a nasty hack. Instead of using [Authorize], we can deal it with the old fashioned way. Here is commit: https://github.com/bitwarden/server/commit/5b6d3dfcbd18bac32b1b8df19c2f890eb652c250
Steps To Reproduce
After installed Bitwarden, I set the
/opt/bitwaden/bwdata/config.yml
as follow:Then, I edited the file
./bwdata/env/global.override.env
adding my email value at theadminSettings__admins=
Then, I set an NGINX conf file with the following content:
Bitwarden works, but if I try to access the Admin Portal reaching
https://yourdomain.com/admin
it redirects tohttps://127.0.0.1/admin/login?returnUrl=%2Fadmin
and it doesn't work.Expected Result
Access the Admin Portal correctly according to the instruction published here: https://bitwarden.com/help/admin-portal/#access-the-admin-portal
Actual Result
Impossible accessing to the Admin Portale because the system redirects to
https://127.0.0.1/admin/login?returnUrl=%2Fadmin
, and it doesn't work.Screenshots or Videos
No response
Additional Context
No response
Build Version
bitwarden.sh version 2022.9.1 Docker version 20.10.18, build b40c2f6 docker-compose version 1.25.0, build unknown
Environment
Self-Hosted
Environment Details