authelia - choose portal or auth basic mode

This commit is contained in:
bunkerity 2021-06-29 20:32:15 +02:00
parent a385183d88
commit c4aef1d606
No known key found for this signature in database
GPG Key ID: 3D80806F12602A7C
3 changed files with 17 additions and 3 deletions

View File

@ -21,7 +21,6 @@ proxy_set_header Remote-User $user;
proxy_set_header Remote-Groups $groups;
proxy_set_header Remote-Name $name;
proxy_set_header Remote-Email $email;
# If Authelia returns 401, then nginx redirects the user to the login portal.
# If it returns 200, then the request pass through to the backend.
# For other type of errors, nginx will handle them as usual.
{% if AUTHELIA_MODE == "portal" %}
error_page 401 =302 {{ AUTHELIA_BACKEND }}/?rd=$target_url;
{% endif %}

View File

@ -903,6 +903,12 @@ Default value :
Context : *global*, *multisite*
The private Authelia address when doing requests from nginx (e.g. : http://my-authelia.local:9091).
`AUTHELIA_MODE`
Values : *portal* | *auth-basic*
Default value : *portal*
Context : *global*, *multisite*
Choose authentication mode : show a web page (`portal`) or a simple auth basic prompt (`auth-basic`).
## misc
`SWARM_MODE`

View File

@ -87,6 +87,15 @@
"label": "Address of the authelia upstream",
"regex": ".*",
"type": "text"
},
{
"context": "multisite",
"default": "portal",
"env": "AUTHELIA_MODE",
"id": "authelia-mode",
"label": "Show the portal or simply auth basic prompt",
"regex": "^(portal|auth\\-basic)$",
"type": "text"
}
]
},