@@ -60,7 +60,7 @@ consumer = oauth.Consumer(key="your-twitter-consumer-key",
6060 secret = " your-twitter-consumer-secret" )
6161
6262# Request token URL for Twitter.
63- request_token_url = " http ://twitter.com/oauth/request_token"
63+ request_token_url = " https ://api. twitter.com/oauth/request_token"
6464
6565# Create our client.
6666client = oauth.Client(consumer)
@@ -84,9 +84,9 @@ import oauth2 as oauth
8484consumer_key = ' my_key_from_twitter'
8585consumer_secret = ' my_secret_from_twitter'
8686
87- request_token_url = ' http ://twitter.com/oauth/request_token'
88- access_token_url = ' http ://twitter.com/oauth/access_token'
89- authorize_url = ' http ://twitter.com/oauth/authorize'
87+ request_token_url = ' https ://api. twitter.com/oauth/request_token'
88+ access_token_url = ' https ://api. twitter.com/oauth/access_token'
89+ authorize_url = ' https ://api. twitter.com/oauth/authorize'
9090
9191consumer = oauth.Consumer(consumer_key, consumer_secret)
9292client = oauth.Client(consumer)
@@ -145,7 +145,7 @@ print
145145
146146# Logging into Django w/ Twitter
147147
148- Twitter also has the ability to authenticate a user [ via an OAuth flow] ( http ://apiwiki .twitter.com/Sign-in-with-Twitter ) . This
148+ Twitter also has the ability to authenticate a user [ via an OAuth flow] ( https ://dev .twitter.com/docs/auth/sign-twitter ) . This
149149flow is exactly like the three-legged OAuth flow, except you send them to a
150150slightly different URL to authorize them.
151151
@@ -221,11 +221,11 @@ from mytwitterapp.models import Profile
221221consumer = oauth.Consumer(settings.TWITTER_TOKEN , settings.TWITTER_SECRET )
222222client = oauth.Client(consumer)
223223
224- request_token_url = ' http ://twitter.com/oauth/request_token'
225- access_token_url = ' http ://twitter.com/oauth/access_token'
224+ request_token_url = ' https ://api. twitter.com/oauth/request_token'
225+ access_token_url = ' https ://api. twitter.com/oauth/access_token'
226226
227227# This is the slightly different URL used to authenticate/authorize.
228- authenticate_url = ' http ://twitter.com/oauth/authenticate'
228+ authenticate_url = ' https ://api. twitter.com/oauth/authenticate'
229229
230230def twitter_login (request ):
231231 # Step 1. Get a request token from Twitter.
@@ -254,6 +254,7 @@ def twitter_authenticated(request):
254254 # Step 1. Use the request token in the session to build a new client.
255255 token = oauth.Token(request.session[' request_token' ][' oauth_token' ],
256256 request.session[' request_token' ][' oauth_token_secret' ])
257+ token.set_verifier(request.GET [' oauth_verifier' ])
257258 client = oauth.Client(consumer, token)
258259
259260 # Step 2. Request the authorized access token from Twitter.
0 commit comments