I have created API token and recorded the value to use in the application. With that I can see all the group details in postman.
But the same is not working with my java application and getting 400 error.
String oktaURL = "https://oktaservername.oktapreview.com/api/v1/groups";
URL url1 = new URL(oktaURL);
httpsClient = (HttpsURLConnection) url1.openConnection();
httpsClient.setRequestMethod("GET");
httpsClient.setRequestProperty("Accept","application/json");
httpsClient.setRequestProperty("Content-Type","application/json");
httpsClient.setRequestProperty("Authorization", "SSWS xxxxxxxxxxx");
httpsClient.setInstanceFollowRedirects(false);
log.info ("Send the GET request");
// Send post request
httpsClient.setDoOutput(true);
Please shed some light with this issue.