Twitter: is it possible for user to manually request and then provide app with access_token
I've been using Twitter Basic Authentication where you simply need to enter login/password and that's enough to post tweets. But now since twitter has turned it off, I have to look into oauth. I do have experience with oauth but I always used the common way to do this - get request token, ask user to "approve app", exchanged request token to access token, then use access token. Unfortunately that's too complicated for my particular task and I really would love to keep oauth as simple as Basic Authenti开发者_Python百科cation was.
The reason for this is that I need to have oauth_token for one user only - admin. So I am looking for something like this: admin goes to twitter and registers app (I guess that can't be avoided), then accesses some twitter page and obtains access_token for this app, then takes key, secret and token and enters them as configs in the admin area. After this the site has the ability to post tweets to admin's profile.
I've been trying to find how to do this with no luck so far so before giving up I decided to confirm that this is not possible (or hopefully possible and I just missed something).
You have 2 options to simplify using a single user application:
If the user that you are going to be logged in as owns the OAuth application, you can login to dev.twitter.com as that user, drill down to the application, then click the 'My Access Token" button on the right. You can then just copy and paste the access token values into your application
Similar to #1, but slightly more laborious: develop a simple application whose sole purpose is to give you the access token for the user you wish to login as (or use a sample application somebody else has made). Then, again, copy and paste the values into your application.
精彩评论