def access_token_view(self, request): oauth_server, oauth_request = initialise_server_request(request) if oauth_request is None: return send_oauth_error(OAuthError('Invalid request parameters.')) try: token = oauth_server.fetch_access_token(oauth_request) return HttpResponse(token.to_string()) except OAuthError, ex: return send_oauth_error(ex)
def access_token_view(self, request): oauth_server, oauth_request = initialise_server_request(request) if oauth_request is None: return send_oauth_error(OAuthError("Invalid request parameters.")) try: token = oauth_server.fetch_access_token(oauth_request) return HttpResponse(token.to_string()) except OAuthError, ex: return send_oauth_error(ex)
def authorise_view(self, request): oauth_server, oauth_request = initialise_server_request(request) if oauth_server is None or oauth_request is None: return send_oauth_error(OAuthError('Invalid request parameters.')) app = oauth_server._get_consumer(oauth_request) try: token = oauth_server.fetch_request_token(oauth_request) except OAuthError, ex: return send_oauth_error(ex)
def authorise_view(self, request): oauth_server, oauth_request = initialise_server_request(request) if oauth_server is None or oauth_request is None: return send_oauth_error(OAuthError("Invalid request parameters.")) app = oauth_server._get_consumer(oauth_request) try: token = oauth_server.fetch_request_token(oauth_request) except OAuthError, ex: return send_oauth_error(ex)