Is it possible to use Authelia with Traefik? if so, are there any docs on doing so?
Yes, it is possible. As I am using the file frontend, i have something like this in my traefik conf (important part is "frontends.hub.auth" where you want authelia jumps in):
[frontends.hub]
entryPoints = ["http", "https"]
backend = "hub"
[frontends.hub.routes]
[frontends.hub.routes.route0]
rule = "Host:hub.example.com"
[frontends.hub.auth]
[frontends.hub.auth.forward]
address = "http://authelia:9091/api/verify?rd=https://login.example.com/%23/"
Note1: "authelia:9091" is the authelia internal docker connection from traefik to authelia.
Note2: "https://login.example.com" is your external connection to authelia (the authelia login page, also behind traefik).
@codefriar Here is the PR that added support: https://github.com/clems4ever/authelia/pull/353
You can also use https://github.com/clems4ever/authelia/tree/master/example/compose as a reference. The examples aren't super clear though due to the way they are structured.
@kusold - Mike, thanks for the reference. I'm having a hard time putting it all together. I'd like to add Authelia to homelabos (https://gitlab.com/NickBusey/HomelabOS) We've already got a well established traefik config setup, and ultimately, I'd like to include Authelia as the forward-auth provider for all traefik fronted services. I don't suppose you have any examples of spinning Authelia up behind traefik, as the forward-auth for traefik services?
Hello @codefriar , unfortunately there is no example in the documentation yet for Traefik. I wanted to let more expert people on Traefik do it but I might write it at some point if nobody raise a hand. In the meantime you can check the traefik suite to understand how traefik is configured in the test I wrote. Sorry for the inconvenience.
It took me a while, but I finally put together a blog post and example repo explaining how to integrate the two.
https://mikekusold.com/blog/2019-07-22-protecting-docker-services-with-openldap/
https://github.com/kusold/authelia-docker-example
The repo is a docker-compose example that should be fairly easy to grok.
Most helpful comment
It took me a while, but I finally put together a blog post and example repo explaining how to integrate the two.
https://mikekusold.com/blog/2019-07-22-protecting-docker-services-with-openldap/
https://github.com/kusold/authelia-docker-example
The repo is a docker-compose example that should be fairly easy to grok.