Check OAuth Facebook token from iOS client on server/API - ios

I have an iOS application that connects via Facebook (FBSDK). The authentication is successful on the app and I can check FBSDKAccessToken.currentAccessToken().
My iOS app is communicating with a Node API, and I would like to send the FB tokens and check they are valid in every request.
My currentAccessToken on the iOS client looks like: 0x12de32171
I've been trying to check it from https://graph.facebook.com/me?access_token=0x12de32171 but I have the "Invalid OAuth access token." error everytime

FBSDKAccessToken.currentAccessToken() is an object. To get the token string, it's FBSDKAccessToken.currentAccessToken().tokenString
Then https://graph.facebook.com/me?access_token=YOUR_TOKEN_HERE works totally fine

Related

Invalid Authorization Code auth_code_not_found in OAuth2

Hi guy I have a simple diagram to explain what I to achieve
first want to authenticate OAuth with mobile because mobile cant receive a callback from auth server so I need to create new simple node server for handle authentication code and get real token everything just fine until getting real token I already send code
you will see URL that console log print
already attach code in URL
I dint know issue come from guess because different referer who getting and obtain code
because I try to use only server:9000 getting and obtain access token is work
we dont need server for obtain token just only external browser and deeplink
here solove workflow
native trigger external browser
browser send authentication request to auth server
authserver send authorization back to browser
browser trigger some address that associate to app with deeplinking also passs auth code with query param
native capture auth token then send code to auth server for obtain access_token
auth server send access token back to native 
native store access token in secure storage like keychain and shared preference 

How to remove access token from uber API while logout?

I am doing integrate uber sdk using oAuth2Client in ios.I got access token using
" https://login.uber.com/oauth/v2/token" but when I was trying to remove token using "https://login.uber.com/oauth/revoke" I got response code "200" but access token not be nill so I am not able to redirect on login screen.and
I directly redirect into
If anyone do uber integration in ios application.Please help me!!
Thanks in advance!!
Calling POST /oauth/revoke invalidates the access_token, refresh_token pair that you have for that user.
However, that user is probably still logged into Uber.com and has an active & valid session with a cookie in the browser.
You probably do not want to log the user out of the browser session, but if you did want to you could direct them to https://riders.uber.com/logout

Accessing SDFC page with oAuth token

I am working iOS app which is using Salesforce oAuth for login.
I would like to load one VF page url in web-container which requires the login to access. As I am already having valid oAuth token, How can I access VF page (salesforce) by passing access token on header request.
If you are using framework of SalesForce iOS SDK and you have a valid OauthToken :
SFOauthCordinator class has a method called [coordinator authenticateWithCredentials:[[SFAccountManager sharedInstanceForAccount:#"user"]credentials]]. This source line gives you a login session by using the existing oAuthToken.

FBSDKAccestoken iOS always return a invalid access token after login again

I have an issue when logging in with Facebook in my iOS app. Everything works ok until I change my Facebook account password. After that, I open my app and it requires that I login again. But after I re-enter my new password and login succeeds, I get the new access token with this call [FBSDKAccessToken currentAccessToken].tokenString and discover that access token is invalid.
I tried to debug with the Facebook Debug tool and I always get this result:
Error validating access token: Session does not match current stored
session. This may be because the user changed the password since the
time the session was created or Facebook has changed the session for
security reasons.
Please help me! :( I need to send this access token to my server so my server can get the user info. But after users change their Facebook account password, the token will become invalid and then my server code doesn't work.

Google+ SignIn Hybrid Approach IOS/Python REST Server

We are trying to incorporate the Google+ SignIn button for authentication to our IOS client and python tornado REST Server.
On the IOS client, we followed the "Enable server-side API access for your app" in https://developers.google.com/+/mobile/ios/sign-in. We set the clientID to the Google+ IOS Client and the homeServerClientID to our web server Google+ Web client id.
Then on our tornado werver, we used the python google+ client and did:
oauth_flow = flow_from_clientsecrets(GOOGLE_CLIENT_SECRET, scope='email')
oauth_flow.redirect_uri = 'postmessage'
credentials = oauth_flow.step2_exchange(code)
So the IOS client works fine, it authenticates, gets the one time token in homeServerAuthorizationCode. It sends this to the REST API and it produces an exception:
File "/usr/lib/python2.6/site-packages/oauth2client/client.py", line 1964, in step2_exchange
raise FlowExchangeError(error_msg)
FlowExchangeError: redirect_uri_mismatch
We have tried to use difference codes, double and triple checked the client ids in the clientsecrets, IOS and tornado code and they are all correct.
Any ideas?
It is likely that it's not happy with the redirect URI on the server side. 'postmessage' is absolutely right for the web flow, but for iOS try either not specifying redirect_uri at all, or using 'urn:ietf:wg:oauth:2.0:oob' (oob being "out of browser") for the redirect_uri.

Resources