Skip to main content

OAuthlib authentication support for Requests.

Project description

This project provides first-class OAuth library support for Requests.

Usage

OAuth takes many forms, so let’s take a look at a few different forms:

import requests
from requests_authlib import OAuth1

url = u'https://api.twitter.com/1/account/settings.json'

client_key = u'...'
client_secret = u'...'
resource_owner_key = u'...'
resource_owner_secret = u'...'

Query signing:

queryoauth = OAuth1(client_key, client_secret,
                    resource_owner_key, resource_owner_secret,
                    signature_type='query')
r = requests.get(url, auth=queryoauth)

Header signing:

headeroauth = OAuth1(client_key, client_secret,
                     resource_owner_key, resource_owner_secret,
                     signature_type='auth_header')
r = requests.get(url, auth=headeroauth)

Body signing:

bodyoauth = OAuth1(client_key, client_secret,
                   resource_owner_key, resource_owner_secret,
                   signature_type='body')

r = requests.post(url, auth=bodyoauth)

Installation

To install requests, you can use pip:

$ pip install requests

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

requests-oauthlib-0.2.0.tar.gz (3.3 kB view details)

Uploaded Source

File details

Details for the file requests-oauthlib-0.2.0.tar.gz.

File metadata

File hashes

Hashes for requests-oauthlib-0.2.0.tar.gz
Algorithm Hash digest
SHA256 e963faeeb6d263aa16c10aa55970c031489e75de4d7242c2a7c1e323f965ca99
MD5 ef04f3229ae62c61f5702cdfc0cb39d6
BLAKE2b-256 10ee696fde84054c15c7d530ac3bfb02390865e2eb0abd6b3bc9db7e2edf9382

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page