@@ -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
6374Create an OAuth2 Client Application
6475-----------------------------------
@@ -111,6 +122,11 @@ page is login protected by django-oauth-toolkit. Login, then you should see the
111122her authorization to the client application. Flag the *Allow * checkbox and click *Authorize *, you will be redirected
112123again 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+
114130Exchange the token
115131++++++++++++++++++
116132At 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
130146When finished playing with your authorization server, take note of both the access and refresh tokens, we will use them
131147for 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