After successfully logging in with my keycloak credentials, my authentication flow passes me to the DUO 2FA checks. After completing them, I spot this warning in my keycloak logs:
Or does it try to again exchange an authorized session for a token again?
The funny part is, if I just type the url in my browser, for the web app I'm trying to log into, in this case giza.example.org, I'm authenticated. Its just the part where I get sent back from DUO to keycloak, and from keycloak to my web app that is not working.
Thanks for taking the time to look at this. And thank you for an otherwise great plugin!
Hello!
I'm writing this since you are one of the active developers for a keycloak "gateway" to be used with traefik.
Using the plugin has been great so far for me, and I've been able to secure my web apps with a simple "traefik" client in Keycloak.
To further increase the security, I've also tried to implement 2FA/MFA through DUO Security, with a plugin(!) for Keycloak - https://github.com/instipod/DuoUniversalKeycloakAuthenticator
This plugin I have tested against https://www.keycloak.org/app/ - and it is working as intended.
But when I use it with my own production environment, I get a "too many redirects" error in my browser after completing the DUO 2FA process.
Here is my traefiks' dynamic.yml configuration:
After successfully logging in with my keycloak credentials, my authentication flow passes me to the DUO 2FA checks. After completing them, I spot this warning in my keycloak logs:
In the browser window, all I see is this error: received bad response from Keycloak:
{"error":"invalid_grant","error_description":"Code not valid"}
I think the problem lies in that when I complete the DUO 2FA, it sends me back to the URL that traefik uses for the keycloakopenid middleware:
https://auth.example.org/realms/traefik/protocol/openid-connect/auth?client_id=traefik&redirect_uri=https%3A%2F%2Fgiza.example.org%2F&response_type=code&state=eyJyZWRpcmVjdF91cmwiOiJodHRwczovL3RydWVuYXMubWFyZ2lkby5vcmcvIn0%3D
Or does it try to again exchange an authorized session for a token again?
The funny part is, if I just type the url in my browser, for the web app I'm trying to log into, in this case giza.example.org, I'm authenticated. Its just the part where I get sent back from DUO to keycloak, and from keycloak to my web app that is not working.
Thanks for taking the time to look at this. And thank you for an otherwise great plugin!