Ejemplo n.º 1
0
    def get_password_grant(self, _request, data, client):
        form = PasswordGrantFormByPhone(data, client=client)
        if not form.is_valid():
            raise OAuthError(form.errors)

        return form.cleaned_data
Ejemplo n.º 2
0
 def get_password_grant(self, _request, data, client):
     # Use customized form to allow use of user email during authentication.
     form = PasswordGrantForm(data, client=client)
     if not form.is_valid():
         raise OAuthError(form.errors)
     return form.cleaned_data
Ejemplo n.º 3
0
 def get_authorization_code_grant(self, _request, data, client):
     form = AuthorizationCodeGrantForm(data, client=client)
     if not form.is_valid():
         raise OAuthError(form.errors)
     return form.cleaned_data.get('grant')
Ejemplo n.º 4
0
 def get_refresh_token_grant(self, _request, data, client):
     form = RefreshTokenGrantForm(data, client=client)
     if not form.is_valid():
         raise OAuthError(form.errors)
     return form.cleaned_data.get('refresh_token')