Unable to sign in to React SPA with Auth JS

I am following the article Article to implement OKTA authentication in a React app.

Upon login, I am receiving the below error even though I am providing the correct credentials.

image

Any suggestions would be helpful.

1 Like

This looks like a straight-forward credentials error or a sign-on policy error. Can you check if the user you are trying to use to login to the React application has a profile available in the OKTA dashboard? and also if the passwords and usernames are correct.

The /authn endpoint you are hitting returns an 401 in three scenarios (A 401 Unauthorized Status Code).

  1. is returned for requests with invalid credentials,
  2. If the user is a locked-out account.
  3. or when access is denied by a sign-on policy.

So you may need to validate if the three reasons are checked out and check the Okta System Logs to see what the real reason is.

You can read more about the responses here

1 Like

In addition to what @krishna mentioned, double check that this is a local Okta user and that their credentials aren’t sourced (and only available) within an external Identity Provider.