OAuth access_token request -> forbidden - api

Yesterday I wanted to get an access_token from my account, tried several websites, every time I tried it I got a white page with "Forbidden".
Does Instagram lock the API Access from User?
Thanks

I didn't have any problem, using oauth.io with a simple Instagram connect:
OAuth.popup("instagram", function(e,r) {
if (e) {
$('#results').html('error: ' + JSON.stringify(e));
return
}
$('#results').html('result from instragram: ' + JSON.stringify(r));
});
You can try directly on http://jsfiddle.net/bumpmann/4Ef8p/ and it should reply something like:
{"access_token":"...","user": {"username":"...","bio":"...","website":"...","profile_picture":"http://images.ak.instagram.com/profiles/...","full_name":"...","id":"123456789"}}
If you don't get that, you have most likely a problem with your Instagram account (or your environment if it works on another device)

here is the solution
login to your instagram account from pc browser
go to Edit Profile
change some of your profile info. example: add or delete some text to Bio
Click submit. a new screen will apear which show you a security picture type the text from picture.
after that you will be able to get access token.

You got "forbidden" because of new instagram "captcha" feature. I cannot still find any official information about it, but if user passes captcha on his mobile, authorization will work again.

For the people those don't understand.
Just go to instagram and reset your password than you will see the captcha.
After filling this in you can retreve the acces token with your application

Related

Teams Email of connected user into message extension teams, message extension continue after login

I've one trouble with my teams custom app. I'm making a custom app that return sign-in action to unlogged user when he try to use a search message extension. Now, my problem is:
How can I resume the query after the user logged?
I return to the user an auth composeExtension type that point to one route of my spa. The user make authentication and correctly return the accesstoken, but then it doesn't continue the search. I've already try call :
microsoftTeams.authentication.notifySuccess({ accesToken: oResponse.accessToken })
but it only close the opened popUp.
Please, help me. Thanks.

Unable to get user info with facebook JS SDK

Possibly the question is being solved somewhere, but I can't find the solution.
The problem is following:
There was created Facebook application for web-sites. Application ID: 838914722867595
All setting were set to "public" for the application. I.e. the status is "This app is public and available to all users"
When trying to get user info with not application owner account with "FB.api('/me', ... " I've got an error:
{ status="not_authorized", authResponse=undefined}
{ message="An active access token must be used to query information about the current user.", type="OAuthException", code=2500}
I need only Facebook user ID.
Calling of "FB.api('/me', ..." is wrapped into "FB.getLoginStatus( ..."
Doing the same with application owner account returns the expected user info results.
{ authResponse={...}, status="connected"}
{ id="1395024780825585", first_name="Evgeny", gender="male", more...}
The url with implemented Facebook JS: http://www.doc4net.com/download/2459616413282
Here is the screenshot of the app setting.
Please, advice
The issue is solved.
Facebook "Like" button DOES NOT provide application permissions on login. Even it is calling the login dialog.
So, first the one is need to be logged in with "Log in" button, which rises the login dialog with requesting to allow application permissions to read facebook user info.
Only after using "Log in" the "Like" button works properly.

Google+ JavaScript API: How to detect user sign in status?

I have deployed Google+ Sign-in Button, now I have to provide Sign-Out Button, before that, I need to know whether the user is still signed in, by which I can then show or hide this button.
I found this documentation: gapi.auth.checkSessionState(sessionParams, callback):
https://developers.google.com/+/web/api/javascript?hl=en#gapiauthchecksessionstatesessionparams_callback
Could someone demo how to use it ?
Many thanks.
gapi.auth2.getAuthInstance().isSignedIn.get()
This returns boolean
You don't need to use a separate function call to determine the user's signed in state if you've already added the sign-in button. The sign-in button's callback is going to trigger either on sign-in, when the page loads, or any time that the user's signed-in status changes. The page load trigger (immediate mode), will also help to indicate if the user is a Google signed-in user or not.
See monitoring the user's signed in status, which shows the different status fields that you can check (Google signed in, app signed in, or signed out).
From Google dev docs :
If you pass null to sessionParams.session_state, you can check if the user is signed in to Google, whether or not they have previously authorized your app.
So your code will be like this:
gapi.auth.checkSessionState({session_state: null}, function(isUserNotLoggedIn){
if (isUserNotLoggedIn) {
// do some stuff
}
});
This is an example of how to use it:
gapi.auth.checkSessionState({client_id:'99999999999.apps.googleusercontent.com'}, signinCallback);
where client_id is the id of your project on g+ console. and siginCallback is a function i created to check the state.
IT'S VERY IMPORTANT to notice that the official api documentation says:
If the argument is true, the supplied session_state is still valid. If the argument is false, it is no longer valid and the application should perform a new re-authorization flow with immediate set to true to get an up-to-date access token or detect a non-authorized or nonexistent Google sign-in session.
But when i recive the response of checkSessionState i get true value when im signed off and false when im signed in. I Dont know if there was an error on the documentation but you can try it by yourself.
Hope this has been helpful for you.
PD: excuses for my awful english
Adapted from Tom Anthony's Blog
One simple way you can use without the use of an API to see if a user is logged into Google + (Or Google/Facebook/Twitter) is to try to access a resource which they would only be able to access if logged in. The code below attempts to load an image resource for which the user needs to be authenticated to access. By default html <img> tags run onload() if an image is successfully returned, but onerror() otherwise.
<img style="display:none;"
onload="function(){document.getElementById('signOutButton').style.visibility = 'hidden';}"
onerror="function(){document.getElementById('signOutButton').style.visibility = 'visible';}"
src="https://plus.google.com/up/?continue=https://www.google.com/intl/en/images/logos/accounts_logo.png&type=st&gpsrc=ogpy0"
/>

Facebook Connect: User has logged in and given permissions, now what?

So i've been trying to get FB Connect working on my site, simply for login and authentication, using the Javascript SDK and following the code at:
https://developers.facebook.com/docs/guides/web/
So the button appears, i click it, a dialog pops up, i click that, presumably my site now has permission to know who i am...
Then what? The guide goes on to saying all the stuff I can access through the Facebook API, all the cool things about permissions, but presumably i need the user's ID or access token or something to get at this stuff. How is that given to me? left as a attribute on one of the elements? Left in a Javascript variable somewhere? Given as an argument to some callback? Thrown high into the heavens for me to receive via satellite downlink?
This is probably incredibly simple, but for the life of me i have not been able to figure it out. Facebook's tutorials have failed me, and so has Google. I want to get this in the Javascript, so I can immediately fill in form-data using the user's Facebook name, put a picture, etc. etc., and presumably send this all back to the server so the server can validate with Facebook that the data is real.
I'm assuming you're using the Login button? https://developers.facebook.com/docs/reference/plugins/login/
If you simply want form info, check out the registration plugin - https://developers.facebook.com/docs/plugins/registration/
However, to answer your question, make an API call to /me. For example:
FB.api('/me', function(user) {
if(user != null) {
// The user object now contains info about the logged in user
}
});
You should subscribe to the auth.login event and wrap the above API call in the successful response, i.e.:
FB.Event.subscribe('auth.login', function() {
// JS to run if when the user logs in, for example, the code snippet above
});

linkedin logout issue

I am logged into my application with linkedin connect, but on logout i logs out of the application and not linkedin. I want user to log out of both linkedin and my application
Facebook have provide an option for the same as below
http://m.facebook.com/logout.php?confirm=1&next={domain url}
IF any one know the same thing with linkedin, It will help me a lot.
Thanks in advance
I have been in trouble for this log out from linkedin for quite sometime but finally found a way out. I have placed my log out link code here:
<a onclick='IN.User.logout(
function redirect()
{
window.location = "logout.php";
}
);'
href="javascript:void(0)">
Log Me Out
</a>
onClick of the logout button, I have called "IN.User.logout" and on its callback, I have given control to the function which redirects to log out script (logout.php in this case) where I log the user out of my system.
I think this should help most of people here.