# Getting SAML assertion via API

**URL:** <https://devforum.okta.com/t/getting-saml-assertion-via-api/595>\
**Category:** SAML\
**Tags:** java, saml\
**Created:** [October 18, 2017, 12:56pm UTC](https://devforum.okta.com/t/getting-saml-assertion-via-api/595 "2017-10-18T12:56:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![serglost](https://avatars.discourse-cdn.com/v4/letter/s/53a042/32.png) [@serglost](https://devforum.okta.com/u/serglost)\
**Post date:** [October 18, 2017, 12:56pm UTC](https://devforum.okta.com/t/getting-saml-assertion-via-api/595/1 "2017-10-18T12:56:20Z")

</div>

Hi, I need some help in next question:

I use SAML 2.0 protocol to login users into the app.  
Also I use Okta SAML Toolkit for Java.  
Right now for receive assertion from Okta I use next flow:

1. Redirect to Okta authentication url,
2. Okta sends me post request to my Single Sign On URL, which contains assertion object.

I want to receive the assertion object in one thread via rest API. Is it possible?  
The case is - I want, that user automatically being authorised, if they authorised in Okta, without redirect.

(User sends some rest query - system authorise in Okta and receive him data)

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![andrea](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/andrea/32/2172_2.png) [@andrea](https://devforum.okta.com/u/andrea)\
**Post date:** [February 12, 2024, 7:05pm UTC](https://devforum.okta.com/t/getting-saml-assertion-via-api/595/2 "2024-02-12T19:05:21Z")

</div>

Closed on February 12, 2024, 7:05pm UTC


