2121
2222class BaseAuthorizationView (LoginRequiredMixin , OAuthLibMixin , View ):
2323 """
24- Implements a generic endpoint to handle *Authorization Requests* as in :rfc:`4.1.1`. The view does not implement
25- any strategy to determine *authorize/do not authorize* logic.
24+ Implements a generic endpoint to handle *Authorization Requests* as in :rfc:`4.1.1`. The view
25+ does not implement any strategy to determine *authorize/do not authorize* logic.
2626 The endpoint is used in the following flows:
27- * Authorization code
28- * Implicit grant
27+
28+ * Authorization code
29+ * Implicit grant
30+
2931 """
3032 def dispatch (self , request , * args , ** kwargs ):
3133 self .oauth2_data = {}
3234 return super (BaseAuthorizationView , self ).dispatch (request , * args , ** kwargs )
3335
3436 def error_response (self , error , ** kwargs ):
3537 """
36- Handle errors either by redirecting to redirect_uri with a json in the body containing error details or
37- providing an error response
38+ Handle errors either by redirecting to redirect_uri with a json in the body containing
39+ error details or providing an error response
3840 """
3941 redirect , error_response = super (BaseAuthorizationView , self ).error_response (error , ** kwargs )
4042
@@ -47,21 +49,23 @@ def error_response(self, error, **kwargs):
4749
4850class AuthorizationView (BaseAuthorizationView , FormView ):
4951 """
50- Implements and endpoint to handle *Authorization Requests* as in :rfc:`4.1.1` and prompting the user with a form
51- to determine if she authorizes the client application to access her data. This endpoint is reached two times during
52- the authorization process:
53- * first receive a ``GET`` request from user asking authorization for a certain client application, a form is served
54- possibly showing some useful info and prompting for *authorize/do not authorize*.
55-
56- * then receive a ``POST`` request possibly after user authorized the access
57-
58- Some informations contained in the ``GET`` request and needed to create a Grant token during the ``POST`` request
59- would be lost between the two steps above, so they are temporary stored in hidden fields on the form.
52+ Implements and endpoint to handle *Authorization Requests* as in :rfc:`4.1.1` and prompting the
53+ user with a form to determine if she authorizes the client application to access her data.
54+ This endpoint is reached two times during the authorization process:
55+ * first receive a ``GET`` request from user asking authorization for a certain client
56+ application, a form is served possibly showing some useful info and prompting for
57+ *authorize/do not authorize*.
58+
59+ * then receive a ``POST`` request possibly after user authorized the access
60+
61+ Some informations contained in the ``GET`` request and needed to create a Grant token during
62+ the ``POST`` request would be lost between the two steps above, so they are temporary stored in
63+ hidden fields on the form.
6064 A possible alternative could be keeping such informations in the session.
6165
6266 The endpoint is used in the followin flows:
63- * Authorization code
64- * Implicit grant
67+ * Authorization code
68+ * Implicit grant
6569 """
6670 template_name = 'oauth2_provider/authorize.html'
6771 form_class = AllowForm
@@ -139,9 +143,9 @@ class TokenView(CsrfExemptMixin, OAuthLibMixin, View):
139143 Implements an endpoint to provide access tokens
140144
141145 The endpoint is used in the following flows:
142- * Authorization code
143- * Password
144- * Client credentials
146+ * Authorization code
147+ * Password
148+ * Client credentials
145149 """
146150 server_class = Server
147151 validator_class = oauth2_settings .OAUTH2_VALIDATOR_CLASS
0 commit comments