You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am having issues creating a basic instance of Caddy that utilizes authentication / authorization via caddy-security locally. With the below configuration, authentication works fine. Authorization fails for an unknown reason, resulting in infinity redirects until the browser stops it.
Configuration
Caddyfile:
{
order authenticate before respond
order authorize before basicauth
security {
local identity store localdb {
realm local
path {$HOME}/.local/caddy/users.json
}
authentication portal myportal {
crypto default token lifetime 3600
crypto key sign-verify debugtoken54321
enable identity store localdb
transform user {
match origin local
action add role authp/user
}
}
authorization policy mypolicy {
set auth url https://auth.localhost/
allow roles authp/user
crypto key verify debugtoken54321
inject header "X-User-Email" from "userinfo|email"
}
}
}
auth.localhost {
route {
authenticate with myportal
}
}
caddy.localhost {
authorize with mypolicy
respond "Hello World"
}
Version Information
Provide output of caddy list-modules --versions | grep -E "(auth|security)" below:
I expected login to work using the default webadmin users credentials. Authentication does work, but authorization causes infinite redirects. The caddy.localhost response is thus never received.
ARG CADDY_VERSION=2.7.6
FROM caddy:${CADDY_VERSION}-builder AS builder
RUN xcaddy build \
--with github.com/greenpau/caddy-security \
FROM caddy:${CADDY_VERSION}-alpine
COPY --from=builder /usr/bin/caddy /usr/bin/caddy
The text was updated successfully, but these errors were encountered:
Describe the issue
I am having issues creating a basic instance of Caddy that utilizes authentication / authorization via
caddy-security
locally. With the below configuration, authentication works fine. Authorization fails for an unknown reason, resulting in infinity redirects until the browser stops it.Configuration
Caddyfile
:Version Information
Provide output of
caddy list-modules --versions | grep -E "(auth|security)"
below:Expected behavior
I expected login to work using the default
webadmin
users credentials. Authentication does work, but authorization causes infinite redirects. Thecaddy.localhost
response is thus never received.Additional context
I am using docker. See my
docker.compose.yml
;with
Dockerfile
:The text was updated successfully, but these errors were encountered: