requests_oauthlib.OAuth1Manager

Here are the examples of the python api requests_oauthlib.OAuth1Manager taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

6 Examples 7

Example 1

Project: foauth.org Source File: providers.py
Function: get_request_token_response
    def get_request_token_response(self, redirect_uri, scopes):
        auth = OAuth1Manager(client_key=self.client_id,
                             client_secret=self.client_secret,
                             callback_uri=redirect_uri,
                             signature_method=self.signature_method,
                             signature_type=self.signature_type)
        return requests.post(self.get_request_token_url(), auth=auth,
                             params=self.get_request_token_params(redirect_uri, scopes),
                             verify=self.verify)

Example 2

Project: foauth.org Source File: providers.py
Function: get_access_token_response
    def get_access_token_response(self, token, secret, verifier=None):
        auth = OAuth1Manager(client_key=self.client_id,
                             client_secret=self.client_secret,
                             resource_owner_key=token,
                             resource_owner_secret=secret,
                             verifier=verifier,
                             signature_method=self.signature_method,
                             signature_type=self.signature_type)
        return requests.post(self.get_access_token_url(), auth=auth,
                             verify=self.verify)

Example 3

Project: foauth.org Source File: providers.py
Function: api
    def api(self, key, domain, path, method='GET', params=None, data=None,
            headers=None):
        protocol = self.https and 'https' or 'http'
        url = '%s://%s%s' % (protocol, domain, path)
        auth = OAuth1Manager(client_key=self.client_id,
                             client_secret=self.client_secret,
                             resource_owner_key=key.access_token,
                             resource_owner_secret=key.secret,
                             signature_method=self.signature_method,
                             signature_type=self.signature_type)
        return requests.request(method, url, auth=auth, params=params or {},
                                data=data or {}, headers=headers or {},
                                verify=self.verify, stream=True)

Example 4

Project: oauth-proxy Source File: providers.py
Function: get_request_token_response
    def get_request_token_response(self, redirect_uri, scopes):
        auth = OAuth1Manager(client_key=self.client_id,
                             client_secret=self.client_secret,
                             callback_uri=redirect_uri,
                             signature_method=self.signature_method,
                             signature_type=self.signature_type)
        return self.session.post(self.get_request_token_url(), auth=auth,
                                 params=self.get_request_token_params(redirect_uri, scopes),
                                 verify=self.verify)

Example 5

Project: oauth-proxy Source File: providers.py
Function: get_access_token_response
    def get_access_token_response(self, token, secret, verifier=None):
        auth = OAuth1Manager(client_key=self.client_id,
                             client_secret=self.client_secret,
                             resource_owner_key=token,
                             resource_owner_secret=secret,
                             verifier=verifier,
                             signature_method=self.signature_method,
                             signature_type=self.signature_type)
        return self.session.post(self.get_access_token_url(),auth=auth,
                                 verify=self.verify)

Example 6

Project: oauth-proxy Source File: providers.py
Function: api
    def api(self, key, domain, path, method='GET', params=None, data=None,
            headers=None):
        protocol = self.https and 'https' or 'http'
        url = '%s://%s%s' % (protocol, domain, path)
        auth = OAuth1Manager(client_key=self.client_id,
                             client_secret=self.client_secret,
                             resource_owner_key=key.access_token,
                             resource_owner_secret=key.secret,
                             signature_method=self.signature_method,
                             signature_type=self.signature_type)
        return self.session.request(method, url, auth=auth, params=params or {},
                                    data=data or {}, headers=headers or {},
                                    verify=self.verify, stream=True)