Getting "invalid_saml_response reason: invalid_destination" error in Keycloak 11 (kubernetes)

Hi everyone,

I’m dealing with an issue for more than a week without being able to solve it. I have Keycloak deployed in a Kubernetes cluster and trying to so a SAML login through IDP. When I send the saml request from my IDP I see the error “Invalid Request” and on the Keycloak logs I see:

type=IDENTITY_PROVIDER_RESPONSE_ERROR, realmId=cdc88f3a-5cc8-4f96-bab6-8ce0b7340a86, clientId=null, userId=null, error=invalid_saml_response, reason=invalid_destination, requestUri=

but I’m on the SAML request and response XML I have:

.... Destination=""

It seems that the problem is the http !== https but I can’t find a way to make the requestUri be always “https”. On version 4.8.3 I had the “fixed” hostname with alwaysHttps = true but now I can’t do that.

This is part of the configuration I’m trying to make it work:

/subsystem=undertow/server=default-server/http-listener=default:write-attribute(name=redirect-socket, value=proxy-https)
/subsystem=undertow/server=default-server/http-listener=default:write-attribute(name=proxy-address-forwarding, value=true)

My kubernetes service manifest is sending traffic from port 80 to port 8080 of keycloak. I tried sending it to port 8443 but didn’t work.

Does someone have any clue what I’m doing wrong?

1 Like