Hi - thank you very much for this post! exactly what I needed. I’m having an issue with redirecting after authentication and can’t figure out why.
followed your instructions to the T. when i go to lets say abc.example.com, login with credentials, it just stays there saying logged in. After this, if i go to abc.example.com its fine, but i can’t manage to get a redirect after authentication.
Just want to double check to make sure that your session: domain: in Authelia’s configuration.yml is set to your root domain and not the subdomain? e.g. example.com and not auth.example.com nor abc.example.com?
also want to point out, since all my apps/services are running on the same host, using this :
(secure) {
forward_auth {args.0} app:9091 {
uri /api/verify?rd=https://auth.abc.duckdns.org
copy_headers Remote-User Remote-Groups Remote-Name Remote-Email
}
}
works fine, just wondering why the other isn’t working.
@cloudedhopes and @mrtcd if you two could just double check your docker compose logs app and see if Authelia is logging anything when you complete a login that might give us some clues as to why post-authentication redirection might not be occurring.
hi @Whitestrake - sorry for the delay. suddenly my Authelia is not working. I tried adding user in the users_database.yml. didn’t work. then i reverted to my previous users_database.yml and now getting this error:
time=“2023-09-15T22:34:28Z” level=info msg=“Authelia v4.37.5 is starting”
time=“2023-09-15T22:34:28Z” level=info msg=“Log severity set to info”
time=“2023-09-15T22:34:28Z” level=info msg=“Storage schema is being checked for updates”
time=“2023-09-15T22:34:28Z” level=info msg=“Storage schema is already up to date”
time=“2023-09-15T22:34:28Z” level=error msg=“Failure running the user provider startup check: error reading the authentication database: could not parse the YAML database: yaml: line 6: found character that cannot start any token” stack=“github.com/authelia/authelia/v4/internal/commands/root.go:287 doStartupChecks\ngithub.com/authelia/authelia/v4/internal/commands/root.go:87 cmdRootRun\ngithub.com/spf13/cobra@v1.6.1/command.go:920 (*Command).execute\ngithub.com/spf13/cobra@v1.6.1/command.go:1044 (*Command).ExecuteC\ngithub.com/spf13/cobra@v1.6.1/command.go:968 (*Command).Execute\ngithub.com/authelia/authelia/v4/cmd/authelia/main.go:10 main\nruntime/proc.go:250 main\nruntime/asm_amd64.s:1594 goexit”
time=“2023-09-15T22:34:28Z” level=fatal msg=“The following providers had fatal failures during startup: user” stack=“github.com/authelia/authelia/v4/internal/commands/root.go:309 doStartupChecks\ngithub.com/authelia/authelia/v4/internal/commands/root.go:87 cmdRootRun\ngithub.com/spf13/cobra@v1.6.1/command.go:920 (*Command).execute\ngithub.com/spf13/cobra@v1.6.1/command.go:1044 (*Command).ExecuteC\ngithub.com/spf13/cobra@v1.6.1/command.go:968 (*Command).Execute\ngithub.com/authelia/authelia/v4/cmd/authelia/main.go:10 main\nruntime/proc.go:250 main\nruntime/asm_amd64.s:1594 goexit”
so been busy trying to sort this out first. It was working until i tried adding the new user.
Given that it’s just a broken redirect, and forward auth appears to be otherwise functional, I’m highly confident that Caddy isn’t being an issue here. I also don’t have the problem, so I don’t think I’m much help.
I’ll tag in @james_d_elliott to see if he’s got any other advice, but most likely I think you may need to troubleshoot Authelia.
What was the error you had in your users_database.yml? I am getting the exact same errors you have but can’t figure it out what is wrong in my users_database.yml
I couldn’t figure it out, I think formatting issue? So I just used the default user_database and carefully edited it. I probably used a tab somewhere in the file. Hope this information helps you.