Flask blueprint to connect to a MediaWiki OAuth server
Project description
Flask blueprint to run OAuth against MediaWiki’s extension:OAuth.
- The blueprint adds these uris:
/login - runs the OAuth handshake and returns the user to /
/login?next=/someurl will return the user to /someurl
/logout - clears the users’ access tokens
/logout?next=/someurl will return the user to /someurl
/oauth-callback - callback from MW to finish the handshake
The users’ OAuth key and secret are stored in the session.
- In addition, flask-mwoauth adds a few convenience functions:
get_current_user(cached=True) reports who the current user is. To confirm the user is still logged in (e.g. tokens have not been revoked), call it with cached=False.
request(api_query) submits an request through the API, using the users’ access tokens. E.g. the current user request runs request({‘action’: ‘query’, ‘meta’: ‘userinfo’}).
An example app is implemented in demo.py.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file flask-mwoauth-0.1.35.tar.gz
.
File metadata
- Download URL: flask-mwoauth-0.1.35.tar.gz
- Upload date:
- Size: 6.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | eae0fab87cc32a39e81586a67578ee33434d5b5074710ac5fedc6ef5eb9cc424 |
|
MD5 | 998d0c4ff0e5e520fc295016ebdf7bc6 |
|
BLAKE2b-256 | 3450eeacb0b044b6e60e864cc41f2a4d2ac0f3a4d413e18f486c770d5363f08e |