Okta single page app sign in

Hi

I am trying to access okta endpoints using implicit flow to get token and id_token.

  • POST api/v1/authn - got sessiontoken
  • GET oauth2/v1/authorize - this gives loginrequired error with reauthenticate MFA in description
  • GET api/v1/users/{userID}/factors send sms
  • POST /api/v1/authn/factors/smsj4n1ofkkznNSTC0h7/verify?
  • POST api/v1/sessions - says unauthorized, i passed the sessiontoken obtained from authn endpoint

Can any one tell me what i was doing wrong please?

You probably don’t want to use the /authn api directly, but instead use an OAuth flow.

Have you taken a look at the Okta Sign-in Widget: https://developer.okta.com/code/javascript/okta_sign-in_widget ?