Okta access token endpoint url returns http 401 error

I could navigate to OKTA server’s login page via /authorize URL and then authentication is successful and coming back to my application. Now trying to get access token. Please help how to solve this in React.

I get the login dialog but receive a 401 on the token endpoint.

I am using the following command.
oktaAuth.signInWithRedirect({ originalUri: ‘/’ });

I am using the following libraries:

Here is my payload:

Here is my response:

Can you provide a screenshot of the OIDC application created in Okta for this integration, to confirm that it is of type “SPA” and that it shows PKCE is enabled?

This is a Web app. We have to use the web app because we need to assign specific users. SPA does not allow for this. It is a React frontend with a .NET Core API backend. Will be authenticating the user on both ends.

@meb_pacden looks like the Okta React Library sets PKCE as true by default. So to configure auth for a web app you need to add and set the parameter pkce: false when initializing the oktaAuth instance. Please try the following:

const oktaAuth = new OktaAuth({
  issuer: 'https://{yourOktaDomain}/oauth2/default',
  clientId: '{clientId}',
  redirectUri: window.location.origin + '/login/callback',
  pkce: false
1 Like