Skip to content

Commit a36f633

Browse files
author
Massimiliano Pippi
committed
Merge pull request #85 from kevinseelbach/fix-issue-84-documentation
Closes #84 fix tutorial documentation
2 parents 1a306b7 + 515a58c commit a36f633

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

docs/changelog.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Changelog
44
_development_
55
-----------
66

7+
* Issue #84: Add information about login template to tutorial.
78
* Issue #64: Fix urlencode clientid secret
89

910

docs/tutorial/tutorial_01.rst

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,18 @@ Configure this setting to allow CORS requests from all domains (just for the sco
5858
5959
CORS_ORIGIN_ALLOW_ALL = True
6060
61-
As a final steps, make a syncdb, start the internal server and login into the admin with your credentials.
61+
.. _loginTemplate:
62+
63+
Include the required hidden input in your login template, `registration/login.html`.
64+
The ``{{ next }}`` template context variable will be populated with the correct
65+
redirect value. Django provides more information on `login templates here
66+
<https://docs.djangoproject.com/en/dev/topics/auth/default/#django.contrib.auth.views.login>`_.
67+
68+
.. code-block:: html
69+
70+
<input type="hidden" name="next" value="{{ next }}" />
71+
72+
As a final step, make a syncdb, start the internal server and login into the admin with your credentials.
6273

6374
Create an OAuth2 Client Application
6475
-----------------------------------
@@ -111,6 +122,11 @@ page is login protected by django-oauth-toolkit. Login, then you should see the
111122
her authorization to the client application. Flag the *Allow* checkbox and click *Authorize*, you will be redirected
112123
again on the consumer service.
113124

125+
__ loginTemplate_
126+
127+
If you are not redirected to the correct page after logging in successfully,
128+
you probably need to `setup your login template correctly`__.
129+
114130
Exchange the token
115131
++++++++++++++++++
116132
At this point your autorization server redirected the user to a special page on the consumer passing in an
@@ -130,4 +146,5 @@ refresh token change their values, otherwise you will likely see an error messag
130146
When finished playing with your authorization server, take note of both the access and refresh tokens, we will use them
131147
for the next part of the tutorial.
132148

133-
So let's make an API and protect it with your OAuth2 tokens in the :doc:`part 2 of the tutorial <tutorial_02>`.
149+
So let's make an API and protect it with your OAuth2 tokens in the :doc:`part 2 of the tutorial <tutorial_02>`.
150+

0 commit comments

Comments
 (0)