@@ -58,7 +58,18 @@ Configure this setting to allow CORS requests from all domains (just for the sco
58
58
59
59
CORS_ORIGIN_ALLOW_ALL = True
60
60
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.
62
73
63
74
Create an OAuth2 Client Application
64
75
-----------------------------------
@@ -111,6 +122,11 @@ page is login protected by django-oauth-toolkit. Login, then you should see the
111
122
her authorization to the client application. Flag the *Allow * checkbox and click *Authorize *, you will be redirected
112
123
again on the consumer service.
113
124
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
+
114
130
Exchange the token
115
131
++++++++++++++++++
116
132
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
130
146
When finished playing with your authorization server, take note of both the access and refresh tokens, we will use them
131
147
for the next part of the tutorial.
132
148
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