
NickS.83539 (Customer) asked a question.
Hi
Is it possible to get a SAML assertion for an application via the Okta API? We are building some automation around fetching the SAML assertion to authenticate against an application's API which requires that we pass it the SAML assertion to it. We currently have it working by screen scraping the response form Okta and parsing the SAML response blob out. Its not elegant and potentially a fragile solution. Ideally we'd like to do it via an API call instead, as far as I can tell from reading the docs, its not something that's supported. Has anyone figured out otherwise?
- $step1 = oktaCheckCreds -oOrg prod -username username@domain.tld -password "d0nut Tella sole" [ POST https://domain.okta.com/api/v1/authn ] { "username": "username@domain.tld", "context": { "userAgent": "PowerShell API Wrapper" }, "password": "d0nut Tella sole", "relayState": "/a/relayState/Value" } $step2 = oktaAuthnQuestionWithState -oOrg prod -stateToken $step1.stateToken -fid $step1._embedded.factors[0].id -answer 'the one that matched' [ POST https://varian.okta.com/api/v1/authn/factors/ufs99vmy99akKn9901d9/verify ] { "stateToken": "00OMiEKt9varTzj-4twcWSYoqtOa9OB2yj9Z0oYkaz", "answer": "the one that matched" } $step2.sessionToken 00P1Zgh0gRgb0FkwrJqSaCvF-OX68ZGIpu7KKJt-gu
Now with sessionToken in hand http://developer.okta.com/docs/examples/session_cookie.html#retrieving-a-session-cookie-by-visiting-an-application-embed-link Now what i've described is based on the user being required to perform MFA to authenticate to Okta. Not based on the application configuration. I'd actually love to get some input on this one from Karl. If the user isn't forced to perform MFA to authenticate can i perform or force a similar transaction that would produce a sessionToken that would satisfiy an application embed + sessionToken for an application that requied MFA? Anyway, hopefully that helps. -MattI have a similar question for user authentication through API.
One of our client used OneLogin as SSO provider and we used SAML assertion endpoint with user credentials and bearer token.
Here is the link for reference - https://developers.onelogin.com/api-docs/1/saml-assertions/generate-saml-assertion
What is equivalent process using Okta api?
I would like to know more about if there is some api to generate the saml-assertion like https://developers.onelogin.com/api-docs/1/saml-assertions/generate-saml-assertion too.