After fetching request token i need to get a pin. And I got it. But its inside html page.
But all I need to get it from url.
I don't want to use my own site as callback, but I still want to get the pin.
With facebook api I can set https://www.facebook.com/connect/login_success.html as callback and it will return me https://www.facebook.com/connect/login_success.html?code=MYCODE and I can get the code parameter from url.
But twitter returns me https://dev.twitter.com/docs/auth/pin-based-authorization page without any code param.
So how do I get pin (code) from my app?
you can try it https://github.com/raidenz/twitteroauth
with this app after user get the oauth_token user need to open link to get pin. and insert the pin back into the form to make this app work
Related
I am writing an iOS app that needs to do some basic work against the "Instagram API". To login a user I simply hit the "URL":
I do this through a web view. I am able to login the user and get the access token from "Instagram".
So my question is:
I want to be able to know the "Instagram userId" of the user I just logged in.
How can I get the user id?
The user_id is in the first part of access_token
xxxxx.xxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxx
user_id = access_token.split(".")[0];
just enter your user name then user id will display
http://jelled.com/instagram/lookup-user-id
So it turns out to be quite simple, I simply didn't figure out how until now. So once the user logs in through the web view the web view returns the access_token. With that I can call this GET:
https://api.instagram.com/v1/users/self?access_token="the access token I just got from the login"
So, all I have to do is use "self" in the url and that combined with the access token will return the user object which contains the username and more.
http://www.otzberg.net/iguserid/
look down the web and you can look about the Instagram User ID Finder, and you should find by yoursef, It's so easy to find.
* Open Google Chrome and access your Instagram Profile Page, e.g. Lufthansa Instagram Page
* Open the Developer Tools (F12 on Windows; ⌥+⌘+i on OS X)
* Click the Console Option
* At the little command prompt enter: window._sharedData.entry_data.ProfilePage[0].user.id and hit enter
* If you get an error, reload the page and try again
* Until Instagram Changes their page, this will output your User-ID
The easiest way to find an instagram user ID from a username is: https://www.thekeygram.com/find-instagram-user-id/. Works for me every time. And they always keep it updated to support the latest instagram api updates (at least from my experience)
I am having a scenario within our iPhone App where people post things on their Facebook wall through our App. User's signup to our App. At a certain action, they post something on their Facebook wall and we want to track if this post will still exist after a certain time.
Once they signup to our App, they will either select as "Public" or "Friends" when they download our App. Is it possible to track from our end whether a certain post still exist or not?
Is there anything on the Facebook account settings as a user to disallow this to check?
When you post a feed, a post-id in returned in response. You can make a call using Graph API: \GET /{post-id}. If the post still exists, it'll return you all the details of the post but if not it will return the error in the response.
But, according to the documentation of /user/feed,
A user access token with read_stream permission is required.
Now this will make the things a bit complicated. Since a user token is valid for only few hours, you have to extend it (validity: 60days) and save it at your end. Also, read_stream perms is required.
To know more about extending the token and refreshing it again, see the "Expiration and Extending Tokens" section here: Access Tokens.
I'm developing a desktop application which is supposed to allow users to login via Twitter.
There seems to be 2 ways to do so, that differ in a way oauth_verifier is returned to the application.
The first one is for web applications and oauth_verifier is returned as a url query parameter when redirecting user back to redirect_url.
The second one is using a PIN displayed to the user, which user enters to the app.
Now Facebook, for example, has a page facebook.com/connect/login_success.html , where FB can redirect a user with ouath_verifier as a query param (e.g. facebook.com/connect/login_success.html?code=<token>. Then I can read that param back from the browser's location field (I'm using an embedded browser).
So, is such a workflow possible with Twitter? Does it have a static page, where it can redirect user with oauth_verifier ?
I haven't been able to find such a page in Twitter's API docs, so I ended up using the main page twitter.com for the redirect. Everything works fine.
I have an app written in Asp.Net MVC and Jquery. The app has a functionality to post a message to facebook wall.
When the user clicks the post button on my custom dialog, i do a redirect to
"https://www.facebook.com/dialog/oauth?client_id=xxxx&display=popup&redirect_uri=http://localhost:xxxx/Posts/AuthorizeFaceBook&scope=publish_stream"
using Jquery. And once the user completes log in to facebook my callback is getting executed without any issues. But how can i pass my Post message to the call back from the original custom dialog?
Is storing the message string in a Session, is the only to way to access the message from the callback ?
Thanks !
You need to include the parameters in your redirect URL. You must also uri encode the redirect URL.
I am working on asp.net mvc. I am trying to search public facebook posts of a user by the facebook url. i.e. I have a textbox in my webpage in that user will enter his facebook url like https://www.facebook.com/xxx.yyy and based on that url i need to find particular user and needs to display all public posts of that user. I have tried with open graph api like,
https://graph.facebook.com/search?q={username found in url}&type=user
but it asks me accesstoken. I will get accesstoken only when user was login to facebook but i need to display user's public posts without asking him for authentication. Please guide me.
You don't necessarily need a User access token to get result from https://graph.facebook.com/search , you can use your App Access Token to retrieve the result.
You can also use the same App Access Token to query the public post of the user by calling to Facebook's end point like
https://graph.facebook.com/<user-id>/posts
Where is the value specified in your textbox as
https://www.facebook.com/<user-id>