This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

Flask-OAuthProvider is an extension that makes it easy to secure your views with OAuth:

@provider.require_oauth()
def user_feed(self):
    ...

It gives you fine grained control over access through the use of realms:

@provider.require_oauth(realm="photos")
def user_photos(self):
    ...

As well as the OAuth parameters such as client key and token:

@provider.require_oauth()
def whoami(self):
    return request.oauth.client_key

Note this extension does NOT give you an OAuth client. For that simply use requests which has OAuthLib backed OAuth support built in. If you want to know more about OAuth check out the excellent guide at hueniverse or dig into the very readable OAuth 1 RFC 5849 spec.

Example

Take a look at the example application for a fully working, SQLite / SQLAlchemy backed OAuth provider in the /examples folder.

Before running the demo you need to install a few dependencies (virtualenv is highly recommended). This will be replaced by a single line of pip soon…:

$ virtualenv venv
$ source venv/bin/activate
(venv)$ git clone https://github.com/idan/oauthlib.git
(venv)$ python oauthlib/setup.py install
(venv)$ git clone https://github.com/ib-lundgren/flask-oauthprovider.git
(venv)$ python flask-oauthprovider/setup.py install
(venv)$ pip install flask-openid sqlalchemy

After installing you can run the demo application:

(venv)$ python flask-oauthprovider/examples/runserver.py

Usage

Flask-OAuthProvider builds opon OAuthLib and its OAuth 1 RFC 5849 Server class. You will need to implement a number of abstract methods, required from either Server (OAuthLib) or OAuthProvider(Flask-OAuthProvider). These methods are mainly data storage or retrieval methods. No assumptions are made about the persistence system you use and as such you are free to use any you see fit.

While implementing your provider class you want to give OAuthLib Server docs and the OAuthProvider source a thorough read.

The implementation guide is on its way, feel free to take a look at the overview pictures of how Flask-OAuthProvider and OAuthLib fit into the OAuth workflow.

When you have hacked together a shiny provider class it will be easy to secure your API with OAuth:

app = Flask(__name__)
provider = YourProvider(app)

@app.route("/my_secrets")
@provider.require(realm="secrets")
def my_secrets(self):
    ...

Install

Flask-OAuthProvider will be easily installed using pip when OAuthLib 0.2.0 is available on pypi

pip install flask-oauthprovider
Release History

Release History

0.1.3

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
flask-oauthprovider-0.1.3.tar.gz (7.3 kB) Copy SHA256 Checksum SHA256 Source Jun 27, 2012

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting