The process goes as follows:
- The website will provide the user with an authorization link; the link will look like this: https://api.twitter.com/oauth/authorize?oauth_token=some_oauth_token
Obtaining the authorization url is done via an api call to the request token resource on twitter
- The user clicks on the link, gets a dialog and either
- clicks on authorize (the case we're interested in)
- or clicks on decline
- The twitter dialog will redirect to the specified redirect_uri, including the request token, request token secret and the oauth verifier
- The application at the redirect_uri will
- read the oauth token parameter and identify the user (oauth token parameter is the request token returned from the get authorization url request)
- obtain an access token, based on the provided code
Generating the authorization url is done using the apstrata scripting method:
the result of this call is going look like:
where authorizationUrl is the url the user needs to directed to, which will show him the "allow" button.
the request token and request secret will be user to identify the user when your application will get the redirect call.
Obtaining the AccessToken/AccessTokenSecret Pair
Obtaining the AccessToken is done using the apstrata scripting method
apsdb.social.twitter.getAccessToken("444444444444444","626262626262662626262", "5cPG4", "0hZLMbCW5dbcVq7SMigsxhDW6fk", "YzQX8rPRaBQXegIGUR9I00lzah");
the response of this code will include a pair of AccessToken and AccessTokenSecret which will be used for all twitter access calls.