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

Hi, I am trying to update Okta widget from 3.2.2 to 7.2.1. I did everything according to the instructions, that is:

{{--OKTA WIDGET--}}
{{--<script src="https://global.oktacdn.com/okta-signin-widget/3.2.2/js/okta-sign-in.min.js" type="text/javascript"></script>--}}
{{--<link href="https://global.oktacdn.com/okta-signin-widget/3.2.2/css/okta-sign-in.min.css" type="text/css" rel="stylesheet"/>--}}

<!-- Polyfill for older browsers -->
<script src="https://global.oktacdn.com/okta-signin-widget/7.2.1/js/okta-sign-in.polyfill.min.js" type="text/javascript"></script>
<!-- Widget bundle for Okta Identity Engine -->
<script src="https://global.oktacdn.com/okta-signin-widget/7.2.1/js/okta-sign-in.oie.min.js" type="text/javascript"></script>
<!-- CSS for widget -->
<link href="https://global.oktacdn.com/okta-signin-widget/7.2.1/css/okta-sign-in.min.css" type="text/css" rel="stylesheet"/>


{{--OKTA AUTH--}}
<script src="https://ok1static.oktacdn.com/assets/js/sdk/okta-auth-js/2.0.1/okta-auth-js.min.js" type="text/javascript"></script>

I commented out the old version, added the new one, then in the config I added:

         useInteractionCodeFlow: true,
         useClassicEngine: false,

And I get this error in the console:

request.ts:129 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.
    at request.ts:129:15

I don’t really know what it is, because as you can see in the config, I gave it not to use the classic engine and set useInteractionCodeFlow to true

Hi @Pozdrawiam. Is your org using Okta Classic or Okta Identity Engine?

If you are using Okta Classic, you will need to set useInteractionCodeFlow to false and useClassicEngine to true.

If you are using Okta Identity Engine, you will need to make sure your application and authorization server are both set to use the Interaction Code grant type.

Please let me know if you have any further questions or issues.

3 Likes

Ok i set set useInteractionCodeFlow to false and useClassicEngine to true.
now i have a new error, i will add that on 3.x version it was working with the same clientId etc:

Client authentication failed. Either the client or the client credentials are invalid.

This is my config:

  let OktaConfig = {
            el: '#widget-container',
            baseUrl: '{{ $oktaConfig['base_url'] }}',
            redirectUri: '{{ $oktaConfig['redirect_uri'] }}',
            useInteractionCodeFlow: false,
            useClassicEngine: true,
            issuer: '{{ $oktaConfig['base_url']  }}/oauth2/{{ $oktaConfig['idp_oauth'] }}',
            clientId: '{{ $oktaConfig['client_id'] }}',
            authParams: {
                display: '{{ $oktaConfig['display'] }}',
                scopes: ['{!! implode("', '", $oktaConfig['scopes']) !!}'],
                responseType: ['{!! implode("', '", $oktaConfig['response_type']) !!}'],
                responseMode: '{{ $oktaConfig['response_mode'] }}',
                ignoreSignature: true
            },
            {{--features--}}
            features: {
                selfServiceUnlock: true,
            },
            {{--theme changes--}}
            language: 'pl',
            logo: 'https://op1static.oktacdn.com/fs/bco/1/fs0c48d384vuqSF3l0h7',
            helpLinks: {
                custom: customLinks,
            },
        };

You might also want to check out our migration guide when switching between different major versions of the widget

What type of app are you using? Is it a web app with a client secret or a SPA without one? My thought is that we switched to pkce: true by default in version 4.x, and your app may only work with Implicit flow of auth code flow. Options for responseType are covered in the AuthJS docs