RauthPython 的 OAuth 库
Rauth 是一个简单的 Python OAuth 1.0/a, OAuth 2.0, 和 Ofly 消费者库,基于 Requests 构建。
特点:
- 支持 OAuth 1.0/a, 2.0 and Ofly
- 常规连接初始化的服务封装
- 认证会话对象提供 keep-alive 支持
- 良好测试 (100% coverage)
- Built on Requests (v1.x)
示例代码:
from rauth import OAuth1Service # Get a real consumer key & secret from https://dev.twitter.com/apps/new twitter = OAuth1Service( name='twitter', consumer_key='J8MoJG4bQ9gcmGh8H7XhMg', consumer_secret='7WAscbSy65GmiVOvMU5EBYn5z80fhQkcFWSLMJJu4', request_token_url='https://api.twitter.com/oauth/request_token', access_token_url='https://api.twitter.com/oauth/access_token', authorize_url='https://api.twitter.com/oauth/authorize', base_url='https://api.twitter.com/1/')
评论