-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HTTPS Server / Microsoft ADFS response? #7
Comments
I was able to modify the saml.http.server.pas to use HTTPS. Now ti figure out how to parse the ADFS XML response. Doesn't match Auth0.com's so it blows up a little bit with missing fields like NameID ... and then if i remove that, it won't parse/show any attributes returned. |
For your first question I usually put my SAML server behind a web server (apache, nginx, caddy, ...) with TLS and reverse proxy configured. For the problem with missing field if you send me the XML file (without sensitive information) I can try to figure out how to handle it. |
well I have the HTTPS part working... since it uses INDY and OpenSSL and such. I have gotten A little closer on things.... I can generate this XML SAML Request and fire it off... `<samlp:AuthnRequest
</samlp:AuthnRequest>` Using this as my SAML request, I finally get to a point, I can put in a user name and password. Not 100% sure yet what to do here. I assume use Sign PubKey and EncPubKey ? but what to exactly do/use, i haven't gotten that far yet... If I skip the SAML request, and go straight to a login page... and go through the process there, this is what the ADFS SAML response looks like...
Hopefully this helps? ... So far this demo has taught me a number of things and I have been able to tweak it and change it to do what I need. But still got a bit more to figure out. The ADFS server setup, I have no control over, and have to bug people for details and help. ( edit, sorry, the XML i keep formatting and pasting here, keeps getting clobbered when looking at the post. But it looks fine in the editor here.... ) For now I can work around the parsing of the response. Already doing so. But the request part, to handle the signing of the request, I am not sure what to do and what to put in the INI files. |
I pulled the two X509 certs from the meta data file. "Sign PubKey" and "Enc PubKey" from the IDP tab... On the "Service Provider" tab, there are 4 keys to set? I was able to generate 2 pem files. sp-private-key.pem ( this has the password set during generation ? ) sp-cert.pem ( this is what i take is the public file ) Then for "Sign PrivKey" this would be set to sp-private-key.pem Then for "Sign PubKey" this would be set to sp-cert.pem I don't know what the next two drop downs are for and what to set... "Enc PrivKey" and "EncPubKey" ( btw its labeled as encPutKey .... ) Also... do I need a password field or something somewhere to set a password for the sp-private-key? In the function SignRequest, i had to modify this line
into
For it to get past that part. It would fail loading without a password. But it gets to this line
and crashes out it looks in the openssl libeay32.dll
which this is the exact code spot here that fails
My thoughts on this possibly... if it has worked in the past... is maybe the OpenSSL DLL files... the ones from https://www.zlatkovic.com/pub/libxml/ are from 2008! ... which won't work with Delphi / Indy SSL support.... which I need.... and am using the DLL's from :edit: Using the OLD 2008 OpenSSL "works" on doing the sign part. Or so it seems. So now it generates a much bigger XML request for the SAML Request. But ADFS fails it. "MSIS0018: The SAML protocol message cannot be read because it contains data that is not valid." So something with the function TSAMLAuthnRequest.AsXML: string; is not generating properly I think when it comes to ADFS. Also 1.2.10 is the API / version this is wrapped/supporting... from 2013... ? So all of this is quite a bit out dated.... and doesn't match up I guess with Latest versions of OpenSSL. |
Doing more messing around... SSOBinding=urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST HTTP-POST by itself wasn't good enough. I've been spending hours and hours a day on this... but only getting a bit further.. maybe? I might have to throw in the towel and say to management that Delphi can't do SAML. At least when it comes to ADFS. I can't get anywhere on this. I even setup my own 2022 Server and ADFS and got to same point. |
Dealing with ADFS
It forcing to use HTTPS
Is there a way with the SPDemo.exe to have the server it creates, to be HTTPS with supplied cert files?
The text was updated successfully, but these errors were encountered: