# IdP Login with Auth0Provider

**URL:** <https://community.auth0.com/t/idp-login-with-auth0provider/159888>\
**Category:** Get Help\
**Tags:** connections, saml-enterprise-connection\
**Created:** [December 9, 2024, 10:58pm UTC](https://community.auth0.com/t/idp-login-with-auth0provider/159888 "2024-12-09T22:58:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![barry](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/barry/32/62701_2.png) [@barry](https://community.auth0.com/u/barry)\
**Post date:** [December 9, 2024, 10:58pm UTC](https://community.auth0.com/t/idp-login-with-auth0provider/159888/1 "2024-12-09T22:58:07Z")

</div>

I have been able to get IdP initiated login to work using Auth0 as my SP and Okta as the IdP. My application is a ReactJS SPA.

However, something that puzzle me is that in our app we use Auth0Provider to handle all the token exchange for logins. This works fine for both login/password logins and currently we also have Google SSO. Auth0Provider works fine for both, but NOT for IdP initiated logins. Why is this?

In order to get IdP initiated logins to work, I had to create a dedicated route. I was finally able to figure this out by following the guidance here: [SSO/SAML for React SPA](https://community.auth0.com/t/sso-saml-for-react-spa/123403)

I am passing the SAML connection\_id in the redirect\_uri and using the connection id to call loginWithRedirect().

Is this a bug in Auth0Provider? Ideally, I would like Auth0Provider to handle this for me. I’d appreciate if someone can explain why it doesn’t.

---

<div class="post-metadata">

**Author:** ![marybeth.hunter](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/marybeth.hunter/32/61955_2.png) [@marybeth.hunter](https://community.auth0.com/u/marybeth.hunter)\
**Post date:** [December 17, 2024, 7:41pm UTC](https://community.auth0.com/t/idp-login-with-auth0provider/159888/3 "2024-12-17T19:41:59Z")

</div>

Hi @barry,

`Auth0Provider` doesn’t handle IdP-initiated logins because it is specifically designed to handle user-initiated logins. For IdP-initiated flows, your app must manually handle the authentication response (such as a SAML assertion or OIDC token) and pass the relevant information to Auth0 to complete the login. This means using a dedicated route and calling `loginWithRedirect()` with the appropriate parameters.

It would be nice if there were more seamless support for IdP-initiated logins directly in `Auth0Provider`. I would recommend submitting feedback about that this following this guide: [How to Submit Product Feedback or Feature Requests](https://community.auth0.com/t/how-to-submit-product-feedback-or-feature-requests/22150)

Thanks,

Mary Beth

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [December 31, 2024, 7:42pm UTC](https://community.auth0.com/t/idp-login-with-auth0provider/159888/4 "2024-12-31T19:42:50Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
