# Okta Sample React SPA is not working

**URL:** <https://devforum.okta.com/t/okta-sample-react-spa-is-not-working/23598>\
**Category:** OAuth/OIDC\
**Created:** [March 9, 2023, 4:14am UTC](https://devforum.okta.com/t/okta-sample-react-spa-is-not-working/23598 "2023-03-09T04:14:01Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![govindtomar21](https://avatars.discourse-cdn.com/v4/letter/g/d2c977/32.png) [@govindtomar21](https://devforum.okta.com/u/govindtomar21)\
**Post date:** [March 9, 2023, 4:14am UTC](https://devforum.okta.com/t/okta-sample-react-spa-is-not-working/23598/1 "2023-03-09T04:14:01Z")

</div>

I’ve been trying to integrate okta auth in react application. So, I started by trying this: [Sign in to your SPA with the embedded Okta Sign-In Widget | Okta Developer](https://developer.okta.com/docs/guides/sign-in-to-spa-embedded-widget/react/main/#run-the-sample-application)  
But, this is showing error: `Uncaught (in promise) OAuthError: The requested feature (Interaction Code flow) isn't enabled in this environment. Ensure that you have Okta Identity Engine enabled and the Interaction Code flow enabled for this application and authorization server.`  
Although I have exported export `USE_INTERACTION_CODE=true` as an env variable.  
I tried googling the error, but, found nothing relevant.

 ![Screenshot 2023-03-09 at 9.42.53 AM](https://global.discourse-cdn.com/oktadev/original/2X/e/e566c9ac273ab9a43e28114db207c35ee0a58304.png)

---

<div class="post-metadata">

**Author:** ![Regis](https://avatars.discourse-cdn.com/v4/letter/r/77aa72/32.png) [@Regis](https://devforum.okta.com/u/Regis)\
**Post date:** [March 10, 2023, 12:19pm UTC](https://devforum.okta.com/t/okta-sample-react-spa-is-not-working/23598/2 "2023-03-10T12:19:36Z")

</div>

Hi @govindtomar21 If you have an OIE tenant, make sure Interaction code is enabled in your app’s configuration. If you are also using a custom authorization server, interaction code grant type has to be enabled in your access policies. Otherwise, you can set USE\_INTERACTION\_CODE=false

 ![Screenshot 2023-03-10 at 12.15.54](https://global.discourse-cdn.com/oktadev/original/2X/f/f357019e606f338ac3b5059fa7213c064e7f255d.png)  
 ![Screenshot 2023-03-10 at 12.16.25](https://global.discourse-cdn.com/oktadev/original/2X/7/75ed41223cbe2f5648ab953b8fe108573c4e3cf2.png)

---

<div class="post-metadata">

**Author:** ![govindtomar21](https://avatars.discourse-cdn.com/v4/letter/g/d2c977/32.png) [@govindtomar21](https://devforum.okta.com/u/govindtomar21)\
**Post date:** [March 10, 2023, 1:31pm UTC](https://devforum.okta.com/t/okta-sample-react-spa-is-not-working/23598/3 "2023-03-10T13:31:32Z")

</div>

Hey @Regis,  
Thanks for reverting back!  
I cannot find `IF Grant type is` section on my dashboard. Can you tell me where it is?

---

<div class="post-metadata">

**Author:** ![Regis](https://avatars.discourse-cdn.com/v4/letter/r/77aa72/32.png) [@Regis](https://devforum.okta.com/u/Regis)\
**Post date:** [March 10, 2023, 2:03pm UTC](https://devforum.okta.com/t/okta-sample-react-spa-is-not-working/23598/4 "2023-03-10T14:03:29Z")

</div>

You see it only if you have API Access Management and uses a custom authorization server, which may not be your case. Do you have the Interaction code option in your app?  
What version of the widget are you using?

---

<div class="post-metadata">

**Author:** ![govindtomar21](https://avatars.discourse-cdn.com/v4/letter/g/d2c977/32.png) [@govindtomar21](https://devforum.okta.com/u/govindtomar21)\
**Post date:** [March 13, 2023, 4:40am UTC](https://devforum.okta.com/t/okta-sample-react-spa-is-not-working/23598/5 "2023-03-13T04:40:30Z")

</div>

No, I don’t have Interaction Code option in my app and the version of the widget is 6.7.1

---

<div class="post-metadata">

**Author:** ![Regis](https://avatars.discourse-cdn.com/v4/letter/r/77aa72/32.png) [@Regis](https://devforum.okta.com/u/Regis)\
**Post date:** [March 13, 2023, 9:37am UTC](https://devforum.okta.com/t/okta-sample-react-spa-is-not-working/23598/6 "2023-03-13T09:37:30Z")

</div>

You must have a classic tenant, interraction code flow is for OIE. You can set it to false to run the sample.  
USE\_INTERACTION\_CODE=false

On your Okta admin dashboard, check the version at the bottom of the page, if you see it ending with a ‘C’, this confirms that you have a classic tenant.  
 ![image](https://global.discourse-cdn.com/oktadev/original/2X/c/cd76f6cc9a148ccec0290d047b37711fc75d0e2f.png)

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/oktadev/original/1X/589c4c5f80de422d01f47cee7185a7fb8227835c.png) [@system](https://devforum.okta.com/u/system)\
**Post date:** [February 13, 2024, 5:03pm UTC](https://devforum.okta.com/t/okta-sample-react-spa-is-not-working/23598/7 "2024-02-13T17:03:39Z")

</div>

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