[keycloak-user] [External] Re: IDP SAML Processing Error

Dmitry Telegin dt at acutus.pro
Fri Aug 17 11:40:33 EDT 2018


Suleyman, thanks for the clarifications,

So in your Keycloak you've got two clients: one OIDC and one SAML, and a SAML IdP (ADFS).
Do you want IdP-initiated SSO from ADFS to both clients? or is it only OIDC one (https-client)?

Dmitry

On Fri, 2018-08-17 at 14:44 +0000, Yildirim, Suleyman wrote:
> Hi Dmitry,
> 
> I have been struggling for many days for that😊 I have two clients and a IDP broker in Keycloak.  
> 
> > https-client: Yes, this is the client that secured the application. Redirect urls point to our application (http://myapplication:8443 application).It is "resource" : "https-client" in Keycloak.json in AngularJS. 
> saml client: sends SAML request via IDP broker
> IDP broker: deals with MS ADFS requests/responses
> 
> Regards,
> Suleyman
> 
> -----Original Message-----
> > From: Dmitry Telegin <dt at acutus.pro> Sent: 17 August 2018 15:24
> > To: Yildirim, Suleyman <suleyman.yildirim at accenture.com>; keycloak-user at lists.jboss.org
> Subject: Re: [External] Re: [keycloak-user] IDP SAML Processing Error
> 
> Hi Suleyman, you're welcome :)
> 
> Glad your SP-initiated SSO finally worked.
> 
> As for IdP-initiated SSO, this is also a well-known situation.
> 
> In a few words, it will work out of the box *only* if you Keycloak client (target application) is also using SAML.
> 
> You mentioned some "https-client(open_id)", does that mean that the application is secured by Keycloak OpenID Connect adapter? (Don't despair, there is a workaround nevertheless.)
> 
> Dmitry
> 
> On Fri, 2018-08-17 at 13:57 +0000, Yildirim, Suleyman wrote:
> > Thanks a lot Dmitry,
> > 
> > It works! When I use my application link, I can successfully get SAML 
> > response from MS ADFS and redirected to application back. Use case is as below.
> > 
> > > However, my client wanted to test directly on their MS ADFS using 
> > > their url (https://urldefense.proofpoint.com/v2/url?u=https-3A__client-5Fadfs-5Flink_adfs_ls_idpinitiatedsignon.aspx&d=DwIFaQ&c=eIGjsITfXP_y-DLLX0uEHXJvU8nOHrUK8IrwNKOtkVU&r=W6co1eMBjqBh4emCmcok5fidBI1eOf715bxeMRmm3-g&m=67Jdm10z1uM35jlf76_8hLfYG6Jw218kWhrnGkaevNE&s=pe8ySJNlKetBMIYwYcaV_1LVhx-aTX2gDdk15e-VbjY&e=). I think it is IDP initiated SSO. He wrote his credentials on login page of MS ADFS clicked sign in. I am redirected to Keycloak IDP https://urldefense.proofpoint.com/v2/url?u=https-3A__myapplication_auth_realms_springboot-2Dquickstart_broker_myIDPAlias_endpoint&d=DwIFaQ&c=eIGjsITfXP_y-DLLX0uEHXJvU8nOHrUK8IrwNKOtkVU&r=W6co1eMBjqBh4emCmcok5fidBI1eOf715bxeMRmm3-g&m=67Jdm10z1uM35jlf76_8hLfYG6Jw218kWhrnGkaevNE&s=0BKswkj_bBt6d0dMqEKurFsuBL0tilkKtemQvb00vYQ&e= and get the Internal Server Error again* but with different error (attached file). I wonder if I need to change any Keycloak settings to enable that.
> > 
> > Use case:
> > > > 1.	The user visits the https://urldefense.proofpoint.com/v2/url?u=http-3A__myapplication-3A8443&d=DwIFaQ&c=eIGjsITfXP_y-DLLX0uEHXJvU8nOHrUK8IrwNKOtkVU&r=W6co1eMBjqBh4emCmcok5fidBI1eOf715bxeMRmm3-g&m=67Jdm10z1uM35jlf76_8hLfYG6Jw218kWhrnGkaevNE&s=g_xo6nRowZ1kiFxn2QrsLzUTP2Oz3pRB6veKjTX6sqY&e= application.
> > > 
> > > > > > 2.	https-client(open_id) finds the user is not authenticated and generates an XML authentication request document. It is redirected to the Keycloak Identity Provider, of which Single Sign-On Service URL is configured as https://urldefense.proofpoint.com/v2/url?u=https-3A__client-5Fadfs_adfs_ls_&d=DwIFaQ&c=eIGjsITfXP_y-DLLX0uEHXJvU8nOHrUK8IrwNKOtkVU&r=W6co1eMBjqBh4emCmcok5fidBI1eOf715bxeMRmm3-g&m=67Jdm10z1uM35jlf76_8hLfYG6Jw218kWhrnGkaevNE&s=wv1iQEWJPlOTFlKSLpfzb6XhnImsHO-7wUi2SCVZDWQ&e=
> > > > > > 3.	The ADFS server extracts the XML auth request document and verifies the signature. Then, user is redirected to the SAML client in Keycloak server. 
> > > > > > 4.	The user enters the credentials to be authenticated.
> > > > 5.	After authentication, the Identity Provider generates an XML authentication response document, which contains a SAML assertion that holds metadata about the user like name and email. User is redirected to the https://urldefense.proofpoint.com/v2/url?u=http-3A__myapplication-3A8443&d=DwIFaQ&c=eIGjsITfXP_y-DLLX0uEHXJvU8nOHrUK8IrwNKOtkVU&r=W6co1eMBjqBh4emCmcok5fidBI1eOf715bxeMRmm3-g&m=67Jdm10z1uM35jlf76_8hLfYG6Jw218kWhrnGkaevNE&s=g_xo6nRowZ1kiFxn2QrsLzUTP2Oz3pRB6veKjTX6sqY&e= application.
> > 
> > Regards,
> > Suleyman
> > 
> > -----Original Message-----
> > > From: Dmitry Telegin <dt at acutus.pro>
> > 
> > Sent: 17 August 2018 00:49
> > > > > > To: Yildirim, Suleyman <suleyman.yildirim at accenture.com>; 
> > > keycloak-user at lists.jboss.org
> > 
> > Subject: [External] Re: [keycloak-user] IDP SAML Processing Error
> > 
> > Hi Suleyman,
> > 
> > You're right, the contents of the Validating X509 Certificates box is invalid, your stacktrace tells that unambiguously. The field is pre- populated once you import FederationMetadata.xml, and you shouldn't change it afterwards.
> > 
> > To avoid recreating the whole IdP, open your FederationMetadata.xml, find the <ds:X509Certificate> element and copy its value to the box verbatim.
> > 
> > Good luck!
> > Dmitry Telegin
> > CTO, Acutus s.r.o.
> > Keycloak Consulting and Training
> > 
> > Pod lipami street 339/52, 130 00 Prague 3, Czech Republic
> > +42 (022) 888-30-71
> > E-mail: info at acutus.pro
> > 
> > On Thu, 2018-08-16 at 17:19 +0000, Yildirim, Suleyman wrote:
> > > Hi,
> > > 
> > > I have a "Uncaught server error: org.keycloak.broker.provider.IdentityBrokerException: Could not process response from SAML identity provider" when get response from MS ADFS server. The route cause of the error is Caused by: java.io.IOException: Short read of DER length. So I suspect that Validating X509 Certificates input box doesn't work as expected in Keycloak: "Certificates must be in PEM format and multiple certificates can be entered by comma (,) ". I have to use Public key and the certificates of the realm separated by comma but I get 500 - Internal Server Error from MS ADFS server and the  error in Keycloak (Attached file: IDP_error.txt). If I only use realm certificate, I get invalid requester error. Any idea of how I can proceed?
> > > 
> > > Details
> > > 
> > > When I use dummy IDP of Keycloak server, I use https://urldefense.proofpoint.com/v2/url?u=https-3A__myapplicationurl_auth_realms_springboot-2Dquickstart_protocol_saml&d=DwIDaQ&c=eIGjsITfXP_y-DLLX0uEHXJvU8nOHrUK8IrwNKOtkVU&r=W6co1eMBjqBh4emCmcok5fidBI1eOf715bxeMRmm3-g&m=-8fNnCezquRNyr7Io0tF57v6RXFvwaZ-DKyKnOYEQyo&s=x6wk6gvgqtVRyOfMPb1wegC1CZGmu21auzX3iFU-85g&e= as SSO url, "email" as "NameID Policy Format" (Attached file: dummyIDPSettings.png). As for real ADFS integration, I setup everything according to that blog https://urldefense.proofpoint.com/v2/url?u=http-3A__blog.keycloak.org_2017_03_how-2Dto-2Dsetup-2Dms-2Dad-2Dfs-2D30-2Das-2Dbrokered.html&d=DwIDaQ&c=eIGjsITfXP_y-DLLX0uEHXJvU8nOHrUK8IrwNKOtkVU&r=W6co1eMBjqBh4emCmcok5fidBI1eOf715bxeMRmm3-g&m=-8fNnCezquRNyr7Io0tF57v6RXFvwaZ-DKyKnOYEQyo&s=X9S93qI_kOVUhIWAq4qzd6DkJBfFb5lVIIiFzin9ixg&e= and use the client's SSO url (Attached file: ADFSIDPSettings.png). I think I did everything right. Keycloak endpoints, SSL keystore and truststore files are at the right locations and places.
> > > 
> > > Regards,
> > > Suleyman
> > > 
> > > 
> > > ________________________________
> > > 
> > > This message is for the designated recipient only and may contain privileged, proprietary, or otherwise confidential information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the e-mail by you is prohibited. Where allowed by local law, electronic communications with Accenture and its affiliates, including e-mail and instant messaging (including content), may be scanned by our systems for the purposes of information security and assessment of internal compliance with Accenture policy. Your privacy is important to us. Accenture uses your personal data only in compliance with data protection laws. For further information on how Accenture processes your personal data, please see our privacy statement at https://www.accenture.com/us-en/privacy-policy.
> > > ____________________________________________________________________
> > > __
> > > ________________
> > > 
> > > www.accenture.com
> > > _______________________________________________
> > > keycloak-user mailing list
> > > keycloak-user at lists.jboss.org
> > > https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.jboss.org
> > > _m 
> > > ailman_listinfo_keycloak-2Duser&d=DwIDaQ&c=eIGjsITfXP_y-DLLX0uEHXJvU
> > > 8n 
> > > OHrUK8IrwNKOtkVU&r=W6co1eMBjqBh4emCmcok5fidBI1eOf715bxeMRmm3-g&m=-8f
> > > Nn 
> > > CezquRNyr7Io0tF57v6RXFvwaZ-DKyKnOYEQyo&s=WX8gpk0AMQYxSW_IQGR_SxG69Wo
> > > cm
> > > nmEIzqruzVr9Gg&e=



More information about the keycloak-user mailing list