Grant not configured for client during get token in Angular 12?

Hi Team,

I have an Angular app and i want to get token i have properly received authorization code but during getting token below error received can anybody help me regarding below issue?

error_description: "Grant not configured for client"

I have pass below payload to API

const body = new HttpParams()
    .set(`grant_type`, "AUTHORIZATION_CODE")
    .set(`redirect_uri`, OAMConfig.redirectUri)
same API properly get token in postman but in app not getting token can anybody help me on above issue?

From your description, seems like you are missing client_id parameter,

Here is the guide for authorization code with pkce (which you would use, if you have selected application type as single page application in Okta). For example

curl --request POST \
  --url https://${yourOktaDomain}/oauth2/v1/token \
  --header 'accept: application/json' \
  --header 'cache-control: no-cache' \
  --header 'content-type: application/x-www-form-urlencoded' \
  --data 'grant_type=authorization_code&client_id=0oabygpxgk9lXaMgF0h7&redirect_uri=yourApp%3A%2Fcallback&code=CKA9Utz2GkWlsrmnqehz&code_verifier=M25iVXpKU3puUjFaYWg3T1NDTDQtcW1ROUY5YXlwalNoc0hhakxifmZHag'

Thanks for the update @ram.gandhi i have tried to pass the client_id in the payload but stil same issue occurred.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.