I am developing a Spring MVC + Apache Oltu + Instagram example. In this example I created an App on https://www.instagram.com/developer/ and I got the
After lots of trial and error method, I was able to resolve this issue:
While making request for the access token I should be using the below:
OAuthClientRequest request = OAuthClientRequest
.authorizationLocation(AUTHORIZATION_URL)
.setClientId(CLIENT_ID)
.setRedirectURI(REDIRECT_URL)
.setResponseType(ResponseType.CODE.toString())
.setScope("public_content follower_list comments relationships likes basic")
.buildQueryMessage();
and with the subsequent request I will be using the below:
OAuthClientRequest request = OAuthClientRequest
//.authorizationProvider(OAuthProviderType.INSTAGRAM)
.tokenLocation(ACCESS_TOKEN_URL)
.setGrantType(GrantType.AUTHORIZATION_CODE)
.setClientId(CLIENT_ID)
.setClientSecret(CLIENT_SECRET)
.setRedirectURI(REDIRECT_URL)
.setCode(authorizationCode)
.buildBodyMessage();
and this gives me the solid Response:
{"data": {"id": "3159574895", "username": "Raj", "profile_picture": "https://scontent.cdninstagram.com/t51.2885-19/s150x150/19367511_329283184160313_6318737005198966784_a.jpg", "full_name": "Raj", "bio": "Wish me on 25th-Dec\nLove to code !! \nEngineer by my choice !!\nLove to drive !! \ud83d\ude0b\ud83d\ude0a", "website": "", "is_business": false, "counts": {"media": 14, "follows": 18, "followed_by": 51}}, "meta": {"code": 200}}
After more google found : OAuthProblem, missing parameter access_token