I'm trying to configure IdP initiated SSO with Google acting as an IdP in order to be able to authenticate to our web app, which supports SSO authentication via Keycloak, by clicking on custom SAML app in Google Workspace popup (basically it's just a link to https://accounts.google.com/o/saml2/initsso?idpid=[IDP ID]&spid=[SP ID]&forceauthn=false
) but the problem I have is that the request to Keycloak (ACS URL) fails with the following error:
If I set Start URL field in Google SSO configuration, with for example my webapp's SSO login page, then it fails with another error:
Failing HTTP request:
- URL:
https://[KEYCLOAK DOMAIN]/realms/[REALM]/broker/[IDENTITY BROKER]/endpoint
- Method: POST
- Status Code: 400
- Form Data:
SAMLResponse=[LONG BASE64]&RelayState=[EMPTY OR Start URL VALUE]
This is the configuration I use for Google custom SAML app:
- ACS URL:
https://[KEYCLOAK DOMAIN]/realms/[REALM]/broker/[IDENTITY BROKER]/endpoint
- Entity ID:
https://[KEYCLOAK DOMAIN]/realms/[REALM]
- Signed response: ON
- Name ID format: EMAIL
- Name ID: Basic Information > Primary email
Keycloak Identity Provider SAML Config:
- Service Provider Entity ID:
https://[KEYCLOAK DOMAIN]/realms/[REALM]
- Single Sign-On Service URL:
https://accounts.google.com/o/saml2/idp?idpid=[IDP ID]
- Single Logout Service URL:
https://accounts.google.com/o/saml2/idp?idpid=[IDP ID]
- NameID Policy Format: Email
- Principal Type: Subject NameID
- HTTP-POST Binding Response: ON
- HTTP-POST Binding for AuthnRequest: ON
- Validate Signature: ON
- Validating X509 Certificates:
[...]
Keycloak Version: 17.0.0
So my question is what could be wrong with this setup and whether it needed to put some URL into Start URL field? Also do I need to configure a separate Keycloak client as I couldn't find any relation between Google SAML / Keycloak IdP and Keycloak client configurations?
UPDATE: