1

Currently, using 1.6.0 of the scripts and CSS files. I have the widget integrated in my Angular 1.5.x app. I have been experiencing issues receiving 404 when trying to render the OKTA Widget as its GET request to:

https://*.oktapreview.com/api/v1/sessions/me

Which means that the widget gets rendered once and I am able to log in, but once I log out, I am not able to re-render the widget without having to refresh the browser first.

Has anyone found and resolved this issue?

Aravind
  • 40,391
  • 16
  • 91
  • 110
Andrew Lobban
  • 2,065
  • 2
  • 24
  • 38

2 Answers2

1

I think this might be related to this Stack Overflow issue. Can you check your privacy settings?

The reason for this issue is because the widget exchanges the sessionToken (which you get after logging in) with an id_token via a hidden iframe, at which time the session cookie is also set. But, since this is in an <iframe>, it's considered a third-party cookie.

There is currently no good way around this when your browser has third-party cookies disabled without redirecting to Okta to set the session cookie. A new version (1.8.0) of the widget is going to be released this week will make this easier (See this commmit which addresses this issue). With this new version, passing in authParams.display = 'page' will perform the call to /authorize via a redirect rather than through the hidden iframe.

Community
  • 1
  • 1
remanc
  • 205
  • 2
  • 10
  • I am glad this will be addressed in the subsequent release. I wouldn't want to tell every user to make this change in their browser. When should I expect this release? – Andrew Lobban Oct 14 '16 at 21:10
  • It's been published and is [available on NPM](https://www.npmjs.com/package/@okta/okta-signin-widget) now, and will roll out to our production CDN in about a week and a half (after going through oktapreview, etc). – remanc Oct 15 '16 at 16:34
  • Ok, I see that 1.8.0 is now available via CDN. Where can I find sample of how to use it? – Andrew Lobban Feb 08 '17 at 19:01
0

Now that 1.8.0 is available via Okta's CDN, here is a sample of how to use the authParams.display = 'page' setting described above:

  <script>
    var config = {
      baseUrl: 'https://YOUR-OKTA-ORG-HERE.okta.com',
      clientId: 'YOUR-OKTA-CLIENT-ID-HERE',
      redirectUri: 'YOUR-REDIRECT-URL-HERE',
      authParams: {
        responseType: 'code',
        display: 'page',
        scopes: ['openid', 'email', 'profile'],
      }
    };
    var oktaSignIn = new OktaSignIn(config);

    oktaSignIn.renderEl({ el: '#app-container' }, () => {});
  </script>
Joël Franusic
  • 1,178
  • 8
  • 18