- Access exclusive content
- Connect with peers
- Share your expertise
- Find support resources
Our community just got stronger! Explore new identity security resources, connect with experts, and discover more ways to learn and collaborate.
02-14-2023 08:59 AM
I am using SAML Logon REST API in Postman and passing the SAMLResponse in the body parameters hoping to receive a token as mentioned in the CyberArk documentation (https://docs.cyberark.com/Product-Doc/OnlineHelp/PAS/Latest/en/Content/SDK/SAML_%20Authentication_%20Logon_newgen.htm?tocpath=Developer%7CREST%20APIs%7CAuthentication%7CLogon%7C_____2).
But instead of getting a token as the response, I am getting the SAMLRequest URL.
The Knowledge Article below explains how to use REST API using SAML auth to generate a token using Postman and PowerShell script, but none of the methods worked for me.
https://community.cyberark.com/s/article/How-to-use-REST-API-SAML-Auth
Anybody experienced this issue or know how to get a token using the SAMLRequest URL received?
02-14-2023 11:46 AM
Hello,
Without seeing what you sent to the API endpoint, I can only guess as to what is going wrong.
Perhaps you would have better luck trying to grab the SAML response using this script: https://github.com/allynl93/getSAMLResponse-Interactive
You would then pass that SAML response into the body of the CyberArk SAML logon API as you mentioned you were already doing.
Aside from that, there may be formatting issues with the URL you are using, or you may be hitting the wrong API endpoint. Since you are able to get the SAML response from your IdP I am not sure this next point is quite as valid, but you must enable IdP-initiated workflows for the SAML integration on your PVWA also.
02-17-2023 06:05 AM
Hello Jah,
Thank you for taking time in replying. Yes, I tried the "PS-SAML-Interactive
.ps1" powershell script that's in the URL you mentioned in your reply to get the SAML Response, but that didn't work in my case. We use SAML + Smart card authentication (for MFA) for logging into PVWA and the PowerShell module clearly says it was not tested for PIV Smart card auth.
So to get the SAML Response, I used F12 key on the keyboard to launch developer tools, opened a web browser and logged in to PVWA as I normally would do (SAML + Smart card) and the SAML Response can be found in the developer tools. I was trying to pass that SAML Response in the Postman to generate a token, but that's not working as I mentioned in my original post.
I figured the SAML Response obtained using the developer tools method wouldn't work to generate a token, because CyberArk treats that as a replay attack and blocks it. I am trying to see if there are any alternate ways to generate the SAML Response without passing the request to CyberArk so that it doesn't treat the request as a replay attack, which can then be used to generate a token. And of course, the method should be for SAML + Smart card auth.
And to your last point, yes, I verified the formatting and the URL that I am using in Postman, everything looks fine. And I already enabled IdP initiated Sign in on PVWA.
Click Accept as Solution to acknowledge that the answer to your question has been provided.
The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!
These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!
The LIVEcommunity thanks you for your participation!

