Help for basic auth utilization

1. The problem I’m having:

could someone help me to implement basic_auth for applications such as minio in this case?
when I setup the current config below, I get the basic_auth prompt and type the correct credentials, then it will redirect me to /login , and again I have the basic_auth prompt , and again type the crendetials and it redirect me again to /login , then I type minio login/password, then again the basic_auth prompt show.
I have tried to setup basic_auth to /login only , but Minio app have redirection when accessing / to /login , and then basic_auth is not shown which can cause issues for me.

anyone can support here ? it is a bit tricky as I want to setup this basic_auth to another applications such as Keycloak etc … means if there is regex to used in Caddy to fix this issue would be nice to suggest what is available
thank you

3. Caddy version: v2.5.2

4. How I installed and ran Caddy: Docker

a. System environment: Docker

b. Command: docker-compose

PASTE OVER THIS, BETWEEN THE ``` LINES.
Please use the preview pane to ensure it looks nice.

c. Service/unit/compose file: docker-compose

PASTE OVER THIS, BETWEEN THE ``` LINES.
Please use the preview pane to ensure it looks nice.

d. My complete Caddy config:

{
        # Global options block. Entirely optional, https is on by default
        # Optional email key for lets encrypt
        email info@BASEURL.com
        # Optional staging lets encrypt for testing. Comment out for production.
        # acme_ca https://acme-staging-v02.api.letsencrypt.org/directory
}

(common) {
        header /* {
                -Server
                -x-powered-by
                -x-debug-token
                -x-debug-token-link
                -x-robots-tag
        }
}
d-minio.BASEURL.org {
        handle {
                basicauth {
                        InnoyaDev AUTH-TOKEN
                }
                reverse_proxy d-minio:9001
        }
        log {
                output file /var/log/caddy/d-minio.BASEURL.org-access.log
                format json
        }
        import common
}

5. Links to relevant resources:

I’m not sure I understand why you want to use basic auth if the app already has its own authentication.

That’s a quite old version of Caddy. Please upgrade to the latest, v2.7.4

I will upgrade to that suggested version.
We want extra security layer for these kind of sensitive apps, that is why we want to use basic_auth using Caddy.
I understand from your reply that there is no solution?

That doesn’t add anything at all other than a false sense of security, frankly.

@Mohammed90 just pointed out to me that Minio uses the Authorization header to authenticate, so no it won’t be possible to use basicauth with it because it’s in direct conflict.

You could consider using forward_auth instead with Authelia or similar.

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