(self, request)
return self.grant_response()
Django view that handles the token endpoint. Returns a JSON formatted
        authorization code.

        **Args:**

        * *request:* Django HttpRequest object.
Django view that handles the token endpoint. Returns a JSON formatted
        authorization code.
Django view that handles the token endpoint . Returns a JSON formatted authorization code .
def __call__(self, request):
        """Django view that handles the token endpoint. Returns a JSON formatted
        authorization code.

        **Args:**

        * *request:* Django HttpRequest object.

        """
        self.grant_type = request.REQUEST.get('grant_type')
        self.client_id = request.REQUEST.get('client_id')
        self.client_secret = request.POST.get('client_secret')
        self.scope = request.REQUEST.get('scope')
        if self.scope is not None:
            self.scope = set(self.scope.split())
        # authorization_code, see 4.1.3.  Access Token Request
        self.code_key = request.REQUEST.get('code')
        self.redirect_uri = request.REQUEST.get('redirect_uri')
        # refresh_token, see 6.  Refreshing an Access Token
        self.refresh_token = request.REQUEST.get('refresh_token')
        # password, see 4.3.2. Access Token Request
        self.email = request.REQUEST.get('email')
        self.username = request.REQUEST.get('username')
        self.password = request.REQUEST.get('password')
        # Optional json callback
        self.callback = request.REQUEST.get('callback')
        self.request = request
        try:
            self.validate()
        except AccessTokenException, e:
            return self.error_response()
        return self.grant_response()
def __call__ ( self , request ) : self . grant_type = request . REQUEST . get ( 'grant_type' ) self . client_id = request . REQUEST . get ( 'client_id' ) self . client_secret = request . POST . get ( 'client_secret' ) self . scope = request . REQUEST . get ( 'scope' ) if self . scope is not None : self . scope = set ( self . scope . split ( ) ) # authorization_code, see 4.1.3.  Access Token Request self . code_key = request . REQUEST . get ( 'code' ) self . redirect_uri = request . REQUEST . get ( 'redirect_uri' ) # refresh_token, see 6.  Refreshing an Access Token self . refresh_token = request . REQUEST . get ( 'refresh_token' ) # password, see 4.3.2. Access Token Request self . email = request . REQUEST . get ( 'email' ) self . username = request . REQUEST . get ( 'username' ) self . password = request . REQUEST . get ( 'password' ) # Optional json callback self . callback = request . REQUEST . get ( 'callback' ) self . request = request try : self . validate ( ) except AccessTokenException , e : return self . error_response ( ) return self . grant_response ( )