OpenID Okta initiated login `AuthSdkError: Unable to parse a token from the url`

Im follow the react-hosted-login sample project here: samples-js-react/okta-hosted-login at master · okta/samples-js-react · GitHub

I created my application in okta like so:

I configured the react-sample appropriately

export default {
  oidc: {
    clientId: '0oaewvbvbyZdmYZb60h7',
    issuer: 'https://dev-572586.oktapreview.com/oauth2/default',
    redirectUri: 'http://localhost:8080/implicit/callback',
    scope: 'openid profile email',
  },
  resourceServer: {
    messagesUrl: 'http://localhost:8000/api/messages',
  },
};

When I run the app, I can successfully login when I click the login button in the react app. i.e It takes me to my okta sign-in page and redirects back with the access token and all that stuff

However, when the login is initiated from okta, I get the following error AuthSdkError: Unable to parse a token from the url:

What am I doing wrong?

when the login is initiated from okta

Can you explain this a little more? You mean when clicking on a chiclet on the End-User Dashboard?

That’s correct. When clicking on a chiclet on the End-User Dashboard results in that error

Your initial login uri shouldn’t be the implicit callback URI. You need to create a /login route to do an authorization call.

OIDC doesn’t have IdP initiated flows, like SAML.

I have an example of a Login route in react here:

You will need to point your initiate login URI to http://localhost:8080/login if you are running my sample.

Make sense?

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