A backend for performing forward authentication with Auth0 using the Traefik reverse proxy.
500K+
This is a SpringBoot backend application written i Kotlin and Java8 for authenticating user with Auth0 in Traefik. Use the forward authentication configuration in Traefik and point it to this backend to protect frontends with Auth0 login.
The backend application supports multiple Auth0 applications and APIs based on the domainname/subdomainname of the application and will save the JWT and the Access Token received from Auth0 as a cookie in the browser. When visitors access a protected frontend configured in Traefik, a http call will be sent to this backend to validate that the user is a valid user.
mvn clean install
mvn spring-boot:run or start the main class AuthApplication from IDE
Put the application.yaml config somewhere where SpringBoot can find it. For example in a /config application directory.
domain: https://xxxxx.xx.auth0.com/
token-endpoint: https://xxx.xx.auth0.com/oauth/token
redirect-uri: http://www.example.test/oauth2/signin
authorize-url: https://xxxx.xx.auth0.com/authorize
default:
name: www.example.test
client-id: <from auth0 application config>
client-secret: <from auth0 application config>
audience: <from auth0 api config> or blank
scope: "profile openid email"
redirect-uri: http://www.example.test/oauth2/signin
token-cookie-domain: example.test
apps:
- name: www.example.test
client-id: <from auth0 application config>
client-secret: <from auth0 application config>
audience: <from auth0 api config> or blank
scope: "profile openid email"
redirect-uri: http://www.example.test/oauth2/signin
token-cookie-domain: example.test
- name: traefik.example.test
client-id: <from auth0 application config>
client-secret: <from auth0 application config>
audience: <from auth0 api config> or blank
scope: "profile openid email"
redirect-uri: http://traefik.example.test/oauth2/signin
token-cookie-domain: traefik.example.test
I am publishing my Docker images to https://hub.docker.com/r/dniel/forwardauth If you want to build your own images, use the docker CLI to build and publish images to your own repo instead.
Check out the helm chart directory helm for template for the Helm chart to create Kubernetes deployment configuration.
Content type
Image
Digest
Size
35.3 MB
Last updated
over 4 years ago
docker pull dniel/forwardauth:c5668cd