How to resolve unauthenticated error after calling REST API endpoint to update the Challenge Questions in WSO2 v5.11.0?

30 views Asked by At

I'm trying to update the WSO2 challenge questions given the users email by calling the rest api endpoint using RestTemplate:

String url = baseUrl + email + "/challenge-questions";
HttpEntity<Payload> request = new HttpEntity<Payload>(payload, headers);

try{
  ResponseEntity response = restTemplate.exchange(url, HttpMethod.PUT, request, String.class);
} catch(Exception e){
  LOG.error(e);
}

Does anyone else get the following error even after providing the authorization token in the headers:

org.springframework.web.client.HttpClientErrorExeption$Unauthorized: 401 :[no body]

If so, how can I resolve this issue?

0

There are 0 answers