@@ -60,7 +60,7 @@ consumer = oauth.Consumer(key="your-twitter-consumer-key",
60
60
secret = " your-twitter-consumer-secret" )
61
61
62
62
# 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"
64
64
65
65
# Create our client.
66
66
client = oauth.Client(consumer)
@@ -84,9 +84,9 @@ import oauth2 as oauth
84
84
consumer_key = ' my_key_from_twitter'
85
85
consumer_secret = ' my_secret_from_twitter'
86
86
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'
90
90
91
91
consumer = oauth.Consumer(consumer_key, consumer_secret)
92
92
client = oauth.Client(consumer)
@@ -145,7 +145,7 @@ print
145
145
146
146
# Logging into Django w/ Twitter
147
147
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
149
149
flow is exactly like the three-legged OAuth flow, except you send them to a
150
150
slightly different URL to authorize them.
151
151
@@ -221,11 +221,11 @@ from mytwitterapp.models import Profile
221
221
consumer = oauth.Consumer(settings.TWITTER_TOKEN , settings.TWITTER_SECRET )
222
222
client = oauth.Client(consumer)
223
223
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'
226
226
227
227
# 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'
229
229
230
230
def twitter_login (request ):
231
231
# Step 1. Get a request token from Twitter.
@@ -254,6 +254,7 @@ def twitter_authenticated(request):
254
254
# Step 1. Use the request token in the session to build a new client.
255
255
token = oauth.Token(request.session[' request_token' ][' oauth_token' ],
256
256
request.session[' request_token' ][' oauth_token_secret' ])
257
+ token.set_verifier(request.GET [' oauth_verifier' ])
257
258
client = oauth.Client(consumer, token)
258
259
259
260
# Step 2. Request the authorized access token from Twitter.
0 commit comments