Skip to content

Commit 9e073c0

Browse files
committed
what did we just do copy
1 parent 911b9ee commit 9e073c0

4 files changed

Lines changed: 14 additions & 4 deletions

File tree

templates/callback-success.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,9 @@ <h2>success</h2>
1111
</ul>
1212
<p>That's it, there's nothing left for you in this demo. Now, because this is a demo and we don't want to access your data any longer, we've deleted our local copy of your token. You can be extra safe and revoke our token from your <a href="https://twitter.com/settings/applications">account settings</a> on Twitter.</p>
1313
<a href="/" class="btn btn-small btn-primary">Let me try again</a>
14+
<hr>
15+
<div>
16+
<p><strong>What did we just do?</strong></p>
17+
<pre class="small">We sent you to an <a href="https://dev.twitter.com/docs/api/1/get/oauth/authorize">authorization URL</a> at Twitter that included the temporary request token. When you authorized our app, Twitter redirected you back to our callback URL with our request token and a verifier parameter. When then called the <a href="https://dev.twitter.com/docs/api/1/post/oauth/access_token"><strong>{{ access_token_url }}</strong></a> endpoint with our application API key, API secret, the request token and the oauth_verifier from the callback. That endpoint provided us with an access token that we could then store and use for calling the APIs on your behalf.</pre>
18+
</div>
1419
{% endblock %}

templates/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<li>Then we will redirect you to Twitter.com using our tokens from step 1, for you to authorize our app.</li>
1010
<li>While at Twitter.com you will authorize twauth-web and you'll then be redirected back to us.</li>
1111
<li>We will consume the OAuth params passed to our callback URL when you are redirected back to us. Using those params we will get your auth token from the Twitter API.</li>
12-
<li>Finally, to confirm that all has been authorized, we'll call the Twitter API to get jaakko to show we are able to retrieve this data on your behalf.</li>
12+
<li>Finally, to confirm that all has been authorized, we'll call the Twitter API to get some information about the user who authorized the app to show we are able to retrieve this data on your behalf.</li>
1313
</ol>
1414
</div>
1515
<p>Ready to give this a shot?</p>

templates/start.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,10 @@
33
{% block containercontent %}
44
<h2>start</h2>
55
<p>We've generated the OAuth request token (<code>{{ oauth_token }}</code>) and are ready for you to authorize <strong>twauth-web</strong>! Just click the button below, you'll be taken to Twitter to login (if you aren't already) and to grant access to <strong>twauth-web</strong>. Afterward you'll be redirected back to us.</p>
6-
<a href="{{ authorize_url }}?oauth_token={{ oauth_token }}" class="btn btn-small btn-success">Authorize twauth-web</a>
6+
<p><a href="{{ authorize_url }}?oauth_token={{ oauth_token }}" class="btn btn-small btn-success">Authorize twauth-web</a></p>
7+
<hr>
8+
<div>
9+
<p><strong>What did we just do?</strong></p>
10+
<pre class="small">We called <a href="https://dev.twitter.com/docs/api/1/post/oauth/request_token"><strong>{{ request_token_url }}</strong></a> with our application API key and API secret to get a temporary oauth request token. We passed our desired callback URL to this method so that Twitter knows where to redirect you after you authorize our app.</pre>
11+
</div>
712
{% endblock %}

twauth-web.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def start():
4646
oauth_token_secret = request_token['oauth_token_secret']
4747

4848
oauth_store[oauth_token] = oauth_token_secret
49-
return render_template('start.html', authorize_url=authorize_url, oauth_token=oauth_token)
49+
return render_template('start.html', authorize_url=authorize_url, oauth_token=oauth_token, request_token_url=request_token_url)
5050

5151
@app.route('/callback')
5252
def callback():
@@ -100,7 +100,7 @@ def callback():
100100
del oauth_store[oauth_token]
101101

102102
return render_template('callback-success.html', screen_name=screen_name, user_id=user_id, name=name,
103-
friends_count=friends_count, statuses_count=statuses_count, followers_count=followers_count)
103+
friends_count=friends_count, statuses_count=statuses_count, followers_count=followers_count, access_token_url=access_token_url)
104104

105105
@app.errorhandler(500)
106106
def internal_server_error(e):

0 commit comments

Comments
 (0)