Unable to get Instagram access token with new basic Instagram API - access-token

I'm getting really frustrated with the new Instagram API, what I need to do is just get things like pictures, comments, and likes from my Instagram feed. I'm following all the steps that they mention over here https://developers.facebook.com/docs/instagram-basic-display-api/guides/getting-access-tokens-and-permissions, but I'm still not able to get the final access token I need in order to interact with the API. After getting a lot of different errors now I'm stuck with:
{"error_type": "OAuthException", "code": 400, "error_message": "Error validating verification code. Please make sure your redirect_uri is identical to the one you used in the OAuth dialog request"}
I have verified everything in my Facebook developer setup and everything is ok, the OAuth URL is identical to the one I'm using in the curl command in order to return the access_token and all the setups seem fine. I have noticed that a lot of people are having the same problems but I can't find something that works for me.
This is the way I'm trying to retrieve the access_token:
curl -X POST https://api.instagram.com/oauth/access_token -F client_id=[client_id] -F client_secret=[code] -F grant_type=authorization_code -F redirect_uri=[url] -F code=AQDJxpW5h4r..
I have read that people are using postman and apparently it works over there but I don't know how to use it, any help will be really appreciated.
Upgrade on this, I was finally able to get the access_token via Postman and when I'm trying to use it now I got this error:
{"meta": {"code": 400, "error_type": "OAuthAccessTokenException", "error_message": "The access_token provided is invalid."}}
This is really disappointing, everything was working just fine before this API change. Any ideas?

Just review of the following in your checklist again:
APP_ID and APP_SECRET of "Instagram APP", which is a product added in the Facebook App.
Access Code once submitted in POST request using CURL or Postman, will become invalid for the next request.
The Website Platform is added in "Facebook App".
Test Instagram Users are added and are not pending.
Lastly, Authenticate using the Instagram Test User Profile.

I had the same issue, and actually lost some time solving it.
In my case I only made the configuration in Instagram Product but didn't change the configuration in the login by facebook product.
In summary, you should have in your app in Facebook developers, two products, one Login by Facebook and the other one Instagram. Both must have the same redirect URL.
Hope this helps.

Related

pinterest v3 api exchange auth code for access token : invalid_grant

Using v3 Pinterest Analytics API
Trying to exchange an authorization code for an access token and I'm getting the following error:
{"error":{"message":"None","oauth_error_code":"invalid_grant"},"code":283,"data":null,"message":"The authorization grant is invalid","endpoint_name":"oauth_access_token","status":"failure"}
In following these instructions:
https://developers.pinterest.com/docs/redoc/#section/User-Authorization/Exchange-the-code-for-an-access-token
I successfully obtained an authorization code. Now I want to exchange it for an access_token. I submit the following curl:
curl -X PUT \
--url https://api.pinterest.com/v3/oauth/access_token/ \
--data "code=1234authcode&redirect_uri=https://myURL.com/&grant_type=authorization_code&client_id=123appId&client_secret=123secret"
The redirect_uri is the same as that which was registered. The app secret and app Id are accurate as per this notification we received today:
Your App ID has been enabled. You can now see your app secret in our Developer App Portal and start building.
I have tried various incarnations of the curl thinking I've botched the args I'm passing in and that's still a possibility, so any help there would be appreciated, however, I'm wondering if my app Id and secret are bad or truly invalid somehow. We've only just received them. Any ideas or theories welcome.
Thanks for your time.
Sorry to answer my own question, but it turns out that the auth code was bad. After fetching a new authorization code I was able to obtain an access_token using the approach shown above. What was initially confusing is that I literally got the original auth code moments before using it so I didn't doubt it's validity as much as I should have I guess.

Yahoo OAuth 2.0 `bearer_token_not_over_ssl` - explain?

I'm using the OAuth 2.0 spec for retrieving fantasy football data in the same way this site is using it: http://yfantasysandbox.herokuapp.com/resource/user/game_teams (github repo: https://github.com/whatadewitt/yfsapi)
After retrieving my access_token and refresh_token, I'm trying retrieve the user teams resource and getting this 401 error for no apparent reason
{
"lang": "en-US",
"description": "Please provide valid credentials. OAuth oauth_problem=\"bearer_token_not_over_ssl\", realm=\"yahooapis.com\""
}
It had been working for a few days and it all stopped working suddenly without me having changed anything. Please let me know if the spec has changed. I'm using the https protocol for each of my API requests and am sure to get new access_tokens if needed. My callbackUrl is also using https if that helps.
Its working perfectly now. Looks like it was a disruption in service with the API and not anything fundamental. Good luck this season!
Another possible explanation is that the urls you are passing are http, not https. I was getting this issue, too, until I updated all of my requests to use https.

Cannot authenticate with Yahoo OAuth

I'm trying to authorize with Yahoo using a link like this:
https://api.login.yahoo.com/oauth2/request_auth?client_id=dj0yJmk9ZHNUWExxZmhHckFDJmQ9WVdrOVdsQmtNa3BKTlRZbWNHbzlNQS0tJnM9Y29uc3VtZXJzZWNyZXQmeD03MA--&redirect_uri=https%3A%2F%2Flastlink.com%2Fauthorize&response_type=code
However it responds with:
Please check the redirect URI in your request and submit again
I tried to search for this topic on ydn forums but they seems to be broken.
The domain of the redirect_uri has to be the same as the callback domain for the YDN App.
I can get a code using redirect_uri=oob:
https://api.login.yahoo.com/oauth2/request_auth?client_id=dj0yJmk9ZHNUWExxZmhHckFDJmQ9WVdrOVdsQmtNa3BKTlRZbWNHbzlNQS0tJnM9Y29uc3VtZXJzZWNyZXQmeD03MA--&redirect_uri=oob&response_type=code

Behance Oauth Token Request Not Redirecting

I'm having trouble getting an oauth token from Behance. I'm familiar with how oauth works and I've followed the steps outlined here: https://www.behance.net/dev/authentication
My redirect_uri matches what I setup in my behance account, and is it is also url-encoded.
https://www.behance.net/v2/oauth/authenticate?client_id=MYCLIENTID&redirect_uri=URLENCODED_REDIRECT&scope=wip_read|wip_write&state=54fde3ee43d79f4d1d1944f5984d686e
When I go to this page, I'm getting an "Oops! No longer supported" and "This page has been removed." Is oauth even available?
My app is set to development, but I should be able to access my own account with that setting. I'd figure this is pretty straight forward, but maybe I'm missing something. I've contacted their support and have received no feedback.

how to get the base-hostename (blog name) with tumblr api after a successfull oauth-authorization

I have a tumblr api-application and i need to receive infos about a specific blog.
To get this information I need the following request:
api.tumblr.com/v2/blog/{base-hostname}/info?api_key={key}
But I don't know how i get the {base-hostname} from the user who is logged in. Oauth provides just the conusmer-key, the consumer-secret, theo auth-token, and the oauth-token-secret. But i need the blog-name which matches with the user credentials. It works perfectly fine with the tumblr_client gem but due to some reason I am not allowed to use ist.
Can anybody help me with that?
I think you can parse the response from /user/info api (which is based on oauth creds provided for the request). It returns the name / url for the user's blog(s), which you can then use in your {base-hostname}.

Resources