Authelia: Compatibility with Traefik?

Created on 4 Jun 2019  路  5Comments  路  Source: authelia/authelia

Is it possible to use Authelia with Traefik? if so, are there any docs on doing so?

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.

All 5 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jkaberg picture jkaberg  路  5Comments

modem7 picture modem7  路  3Comments

greenpau picture greenpau  路  4Comments

jrruethe picture jrruethe  路  3Comments

J7mbo picture J7mbo  路  4Comments