# What to do after SAML assertion is returned to service provider?

**URL:** <https://community.auth0.com/t/what-to-do-after-saml-assertion-is-returned-to-service-provider/187102>\
**Category:** Get Help\
**Tags:** connections, saml-enterprise-connection\
**Created:** [May 23, 2025, 6:45am UTC](https://community.auth0.com/t/what-to-do-after-saml-assertion-is-returned-to-service-provider/187102 "2025-05-23T06:45:29Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![remus.ivan](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/remus.ivan/32/68771_2.png) [@remus.ivan](https://community.auth0.com/u/remus.ivan)\
**Post date:** [May 27, 2025, 6:38pm UTC](https://community.auth0.com/t/what-to-do-after-saml-assertion-is-returned-to-service-provider/187102/3 "2025-05-27T18:38:44Z")

</div>

Hi @jeremybong,

Welcome to the Auth0 Community and thank you for your post!

> [@jeremybong](#):
>
> I have read that I can request an auth token using the SAML assertion.

Even though what you are specifying here is correct when it comes to standard OAuth 2.0 flows, this is not a standard way of processing SAML assertions in Auth0, so that is why the error mentioned shows up. When the assertion is validated in Auth0, a user session is created right away.

The recommended approach would be using one of our SDK’s, such as the [Auth0-React](https://github.com/auth0/auth0-react) in your use case ( you can check out the documentation [here](https://auth0.github.io/auth0-react/functions/useAuth0.html) ) which handles the SAML response automatically, as well as generating the tokens. Then you can initiate the login using:

```auto
loginWithRedirect({
          connection: "YOUR_SAML_CONNECTION_NAME", 
        })

```

I would also suggest checking this community posts that will better clarify the situation:

- [Using SAML response to get a JWT access token](https://community.auth0.com/t/using-saml-response-to-get-a-jwt-access-token/67746)

- [SAML 2.0 Assertion flow](https://community.auth0.com/t/saml-2-0-assertion-flow/63403)

- [Custom SSO SAML Integration with Auth0 as SP](https://community.auth0.com/t/custom-sso-saml-integration-with-auth0-as-sp/63315)

I hope this helps, so if you have any questions please let me know.  
Thanks,  
Remus

---

_[View the full topic](https://community.auth0.com/t/what-to-do-after-saml-assertion-is-returned-to-service-provider/187102)._
