I have keycloak on port 8081, proxied by nginx on 443 on a path /saml-sp. I followed all of the docs to set up the proxy. The well known open-id endpoint check and IP address check all look good.
However, I have a SAML 2 Identity Provider integration which fails after submitting the login page there. The error in the keycloak logs is invalid_destination, but the destination in the SAML looks exactly like the endpoint. I have fontendUrl set as well to the external address. I must be missing something but I don't know what. Here's the error:
2020-10-02 08:55:36,888 WARN [org.keycloak.events] (default task-117) type=IDENTITY_PROVIDER_RESPONSE_ERROR, realmId=aerograph, clientId=null, userId=null, ipAddress=xxx.xxx.xxx.xxx, error=invalid_saml_response, reason=invalid_destination
This is my nginx config:
location /saml-sp/ {
client_max_body_size 1000m;
proxy_connect_timeout 7d;
proxy_send_timeout 7d;
proxy_read_timeout 7d;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header Host $host;
proxy_pass http://localhost:8081/;
}
Thanks for any help.