<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-M74D8PB" height="0" width="0" style="display:none;visibility:hidden">
Loading
Skip to NavigationSkip to Main Content
0D54z00006xJTVVCA4Okta Identity EngineWorkflowsAnswered2024-03-08T00:44:18.000Z2021-05-05T17:38:17.000Z2021-05-08T18:47:43.000Z

PaulT.65384 (Customer) asked a question.

OAuthError: Policy evaluation failed for this request, please check the policy configurations.

I'm trying to implement OIDC authetication in a React app using the @okta/okta-react (5.1.1) and @okta/okta-auth-js (4.9.0) npm packages. Within my development account, I've created an SPA client application, associating it with one of my user accounts, and I've also created an authorization server that will be used to authorize the API calls that the React app will make to its backend service. I've established that the backend service calls are already authorized successfully using Postman.

 

I've wrapped my React app with the `Security` component, and I've configured the OktaAuth client as follows:

 

```javascript

const oktaAuth = new OktaAuth({

  issuer: process.env.REACT_APP_IDP_URL,

  clientId: process.env.REACT_APP_IDP_CLIENTID,

  redirectUri: window.location.origin + "/login/callback",

  scopes: ['svc.document-generator', 'openid', 'profile', 'email','address','phone','offline_access'],

  pkce: true,

  disableHttpsCheck: true,

});

```

 

Note that the value of the `issuer` property is set to the URL of the authorizer I created for the backend service, not the default authorizer. My custom authorizer includes the svc.document-generator scope, and has an access policy that grants access to all clients and users.

 

When I try to access one of the secure routes in the app, I get redirected to the Okta login page successfully, and I can log in with the user account that's assigned to the SPA application. However, when Okta tries to redirect to the login callback, I get the following error:

 

```

OAuthError: Policy evaluation failed for this request, please check the policy configurations.

```

 

Can anyone suggest what I'm doing wrong and/or what I can do to get this working?

 

 


This question is closed.
Loading
OAuthError: Policy evaluation failed for this request, please check the policy configurations.