my problem is that I don't know how to get verifier code from the redirected URL. The code is being echoed in the body.
HttpURLConnection igConnection = (HttpURLConnection) instagramURL.openConnection();
igConnection.setDoInput(true);
igConnection.setDoOutput(false);
if (igConnection.getResponseCode() == HttpURLConnection.HTTP_OK){
InputStream is = igConnection.getInputStream();
String response = "";
if (is != null){
BufferedReader in = new BufferedReader(new InputStreamReader(is));
StringBuffer input = new StringBuffer();
String line;
while ((line = in.readLine()) != null) {
input.append(line);
}
in.close();
System.out.println(input.toString());
}
}
What I do get is beginning like <html>
...
I just wanted to refresh the accessToken in case it expires in the future (checking).
My authorization link is correct according to this pattern