Why doesn't Apache Oltu Instragram integration return access_token

后端 未结 1 1801
小鲜肉
小鲜肉 2021-01-16 23:54

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

相关标签:
1条回答
  • 2021-01-17 00:49

    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

    0 讨论(0)
提交回复
热议问题