0

I'm trying to use Keycloack as a SAML server. I deployed my keycloack (v21.1.2) instance with:

docker run --name keycloak_dev2 -p 8089:8080 \                                                 
       -e KEYCLOAK_ADMIN=admin -e KEYCLOAK_ADMIN_PASSWORD=admin \
        quay.io/keycloak/keycloak:latest \
        start-dev --hostname-url=http://localhost:8089

I set up a realm and client with type SAML and various configs that seem fairly basic (can share more if that's useful).

I'm able to get my Python application to redirect to keycloack, am able to login, but in the process of getting redirected back to my application, I get a 500 and the keycloack server has this error:

Uncaught server error: java.lang.RuntimeException: empty host name

The call that triggers this is:

http://localhost:8089/realms/<REALM_NAME>/protocol/saml?SAMLRequest=<LONG_KEY_HERE>&RelayState=<APPLICATION_URL>

I've tried specifying all kinds of options to the docker run command (KC_HOSTNAME, --hostname, etc...) and I still get the same error. I can't find anything online about why this error is showing up. Does anyone have any ideas?

Milylitre
  • 21
  • 5
  • I think `http://localhost:8089/realms//protocol` not use `` – Bench Vue Jul 07 '23 at 21:59
  • 1
    Oh yes, I meant that it's the realm name. My realm and client are named the same – Milylitre Jul 10 '23 at 16:11
  • I'm not sure what I did, but it started working suddenly – Milylitre Jul 10 '23 at 16:12
  • I have not an experence to connect SAML 2.0 connection but you needs to start click the `SAML 2.0 Identity Provide meta data` in [here](https://stackoverflow.com/questions/72596189/keycloak-all-api-response-with-404/72596462#72596462) – Bench Vue Jul 10 '23 at 16:17

0 Answers0