HttpClient httpClient = new HttpClient();
PostMethod post = new PostMethod(environment);
post.addParameter("code", code);
post.addParameter("grant_type", "authorization_code");
post.addParameter("redirect_uri", "https://******.ngrok.io/auth");
post.addParameter("client_id", "3MVG9d8..z.hDcPLDlm9QqJ3hRa..IRUJdGRp4Shjuu01GT.H5KRjos_xlbZEtYGy55M6SzOOELg7sfD4T6Pl");
post.addParameter("client_secret", "*********");
After executing this I get an access token:
accessToken = jsonObject.get("access_token").getAsString();
useridURL = jsonObject.get("id").getAsString();
with which I try to fire a get method to get the userinfo:
GetMethod getMethod = new GetMethod(useridURL);
getMethod.addRequestHeader("oauth_token", accessToken);
httpClient.executeMethod(getMethod);
String responseUserName = getMethod.getResponseBodyAsString();
but I always get this error: Missing_OAuth_Token
, I am not sure if I am missing something here?