# 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:** 7

<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 28, 2025, 10:25pm UTC](https://community.auth0.com/t/what-to-do-after-saml-assertion-is-returned-to-service-provider/187102/7 "2025-05-28T22:25:56Z")

</div>

Hi @jeremybong,

Firstly I would not recommend setting your callback function to your /login, but to the Root URL directly or a simple `/callback` route, since that should be the reason why this is causing a loop in your application. A few details on setting the Callback URL in a React app can be checked using this [community post](https://community.auth0.com/t/callback-url-after-login/106768/3).

The “Login required” error is most likely caused by calling `getAccessTokenSilently` at the wrong moment in time. The SDK might still have to parse the `code` and `state` parameters received from the Idp, so it might not have processed the full authentication flow yet and an unauthenticated session is being returned. I can recommend checking the `isLoading` and `isAuthenticated` functions from the [useAuth0 hook](https://auth0.github.io/auth0-react/functions/useAuth0.html) in the React SDK.

Hope this helps!  
Thanks,  
Remus

---

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