没有项目描述
bottle-rauth的Python项目详细描述
bottle rauth–简短描述。
文档可在https://bottle rauth.readthedocs.org/上获得。拉动请求 通过文档增强和/或修复是非常棒的,非常受欢迎。
Requirements
- python=2.6
Usage
import bottle from bottle_rauth import RAuthPlugin app = bottle.Bottle() app.install(RAuthPlugin(github={ 'type': 'oauth2', 'client_id': 'e3e297bb9f506cbea557', 'client_secret': 'd113380beb8f1ed8a77b688e2b81b76c9be00d09', 'authorize_url': 'https://github.com/login/oauth/authorize', 'access_token_url': 'https://github.com/login/oauth/access_token', 'base_url': 'https://api.github.com/', })) @app.route('/') def index(): return '<a href="/github">Login with github</a>' @app.route('/github', provider='github') def github(rauth): info = rauth.get('user').json() info['token'] = rauth.access_token return info if __name__ == '__main__': app.run(port=5000)
Bug tracker
如果您有任何建议、错误报告或 烦恼请向问题追踪者报告 在https://github.com/klen/bottle-rauth/issues
Contributors
- klen(基里尔·克莱诺夫)
License
根据BSD license授权。