1

I am trying to use OKTa for APP to APP authentication inside a SpringBoot Application and I get the below Scope issues ,

org.springframework.web.client.HttpClientErrorException$BadRequest: 400 Bad 
Request: [{"error":"invalid_scope","error_description":"One or more scopes 
are not configured for the authorization server resource."}]

we have default custome_scope mentioned at the Okta sever and when I try using the below code I am getting error while accesing line no 5 : in the below code snippet ,

String tokenUri = issuerUri + "/v2/token" + "? grant_type=client_credentials&response_type=token&scope=read";
RestTemplate rt = new RestTemplate();
headers = setHeaders(clientId, clientSecret, headers);
HttpEntity requestEntity = new HttpEntity(headers);
TokenData response = rt.postForObject(tokenUri, requestEntity, TokenData.class);

Can anyone help me

Anurag Dabas
  • 23,866
  • 9
  • 21
  • 41
Susheel Rao
  • 79
  • 1
  • 7

0 Answers0