How to configure a second traefik-forward-auth on the same traefik instance? #30

Closed
opened 2021-11-20 13:09:00 +00:00 by 3wordchant · 0 comments
Owner

Let's say we have swarm.example.com, running:

  • id.project.org (Keycloak)
  • secret.project.org (custom-html)
  • id.otherproject.org (Keycloak)
  • secret.otherproject.org (custom-html)

We want secret.project.org to require id.project.org login, and secret.otherproject.org to require id.otherproject.org login.

Currently, we can deploy two coop-cloud/traefik-forward-auth instances with different stack names, and configure them to point at the two Keycloak instances.

But! There's no way to tell Traefik about the second instance, because we only have one "slot" for an auth middleware.

One approach could be to duplicate that section, and have e.g. KEYCLOAK_MIDDLEWARE_2_ENABLED variable, keycloak2 middleware. This would (I think!) work fine for this specific case, but scaling to supporting a 3rd, 4th etc traefik-forward-auth would be increasingly annoying.

Is there any better way to define a variable set of auth middlewares?

Let's say we have swarm.example.com, running: - `id.project.org` (Keycloak) - `secret.project.org` (custom-html) - `id.otherproject.org` (Keycloak) - `secret.otherproject.org` (custom-html) We want `secret.project.org` to require `id.project.org` login, and `secret.otherproject.org` to require `id.otherproject.org` login. Currently, we can deploy two coop-cloud/traefik-forward-auth instances with different stack names, and configure them to point at the two Keycloak instances. But! There's no way to tell Traefik about the second instance, because [we only have one "slot" for an auth middleware](https://git.coopcloud.tech/coop-cloud/traefik/src/branch/master/file-provider.yml.tmpl#L4-L10). One approach could be to duplicate that section, and have e.g. `KEYCLOAK_MIDDLEWARE_2_ENABLED` variable, `keycloak2` middleware. This would (I think!) work fine for this specific case, but scaling to supporting a 3rd, 4th etc `traefik-forward-auth` would be increasingly annoying. Is there any better way to define a variable set of auth middlewares?
Sign in to join this conversation.
No Label
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: coop-cloud/traefik#30
No description provided.