An OAuth 2.0 module for web2py framework, based in:
- Python
From web2py\applications
, clone the app git clone https://github.com/SamuelMarks/web2py-oauth2.git oauth2
Then follow these steps to test the module:
- Add a client (
http://your_server[:port]/application/add_client
) - Change the
client_id
,client_secret
andredirect_uri
atcontrollers/callback.py
for the ones given by the above step - Browse
http://your_server[:port]/application/auth
with the required parameters and click "Yes" - Get the
access_token
andrefresh_token
curl -H "Authorization: Bearer access_token_here" http://your_server[:port]/application/protected_resource
Want to contribute? Great! Just fork this project and/or make a pull request ;)
- Unit tests
- Upgrade from Draft 20 to released OAuth2 standards
My major changes to João Alves' code can be summarised in three points:
- Reviewed the entire codebase; improving quality, fixing hacks and improving formatting along the way.
- Rewrote all the relevant exceptions to use gluon.http.HTTP (with correct HTTP error codes + easier to understand specific exception messages)
- Implemented subclasses of OAuthStorage for web2py's DAL. Now this project is no longer locked-into MongoDB ;]