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


#1

Im follow the react-hosted-login sample project here: https://github.com/okta/samples-js-react/tree/master/okta-hosted-login

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?


#2

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?


#3

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


#4

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?