Skip to main content

Flask Based Heroku Authentication.

Project description

Flask-Heroku-Auth

https://travis-ci.org/rhyselsmore/flask-heroku-auth.png?branch=master https://pypip.in/d/Flask-Heroku-Auth/badge.png

A set of Flask Route decorators to enable either Session-Based Authentication via Heroku’s OAuth mechanism, or Basic Stateless Authentication via Heroku’s API Key facilities.

Installation

pip install flask-heroku-auth

Configuration

To enable regex routes within your application

from flask import Flask
from flask_heroku_auth import HerokuAuth

app = Flask(__name__)
HerokuAuth(app)

or

from flask import Flask
from flask_heroku_auth import HerokuAuth

auth = HerokuAuth()

def create_app():
    app = Flask(__name__)
    auth.init_app(app)
    return app

From here, it is a matter of decorating the appropriate routes.

For example, the following would implement authentication via the Heroku OAuth facility

@app.route('/')
@auth.oauth
def index():
    return "Ok"

On the other hand, you may wish to authenticate via the Heroku API Key facility. In this case, the credentials are sent through with every request as an ‘Authorization’ header

@app.route('/')
@auth.api
def index():
    return "Ok"

You can also restrict access to a Heroku user who has an @heroku.com email address.

@app.route('/')
@auth.oauth
@auth.herokai_only
def index():
    return "Ok"

History

0.0.1 (24/08/2012)

  • Conception

  • Initial Commit of Package to GitHub.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Flask-Heroku-Auth-0.0.1.tar.gz (5.5 kB view details)

Uploaded Source

File details

Details for the file Flask-Heroku-Auth-0.0.1.tar.gz.

File metadata

File hashes

Hashes for Flask-Heroku-Auth-0.0.1.tar.gz
Algorithm Hash digest
SHA256 c8ed1492dc9d22a28e0d854535b3e90165621ca735d1ec726e52f537de2a18b7
MD5 60693013c6bf0ea005149761b7170a96
BLAKE2b-256 fbfad4d1b1249eefa65d6cbea78778288cf3d3cdf0083d65f7b0a3898ff725ea

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page