Skip to main content

Bootle authentication, for Personal, Google, Twitter and facebook.

Project description

Bottle plugin authentication, support with Google, Twitter and Facebook

Example

from bottle import Bottle, redirect, request, run
from bottle.ext import auth
from bottle.ext.auth.decorator import login
from bottle.ext.auth.social.facebook import Facebook, UserDenied
from bottle.ext.auth.social.facebook import NegotiationError
from pprint import pformat

facebook = Facebook('fb-key', 'fb-secret',
                    'http://127.0.0.1:8000/', 'email')

app = Bottle()
plugin = auth.AuthPlugin(facebook)
app.install(plugin)


@app.route('/login')
def login(auth):
    return auth.redirect(request.environ)


@app.route('/')
@login(auth)
def home():
    user = auth.get_user(request.environ)
    return "Home page {}".format(pformat(user))


run(app=app, host='0.0.0.0', port='3333', debug=True)

Application in production: https://github.com/avelino/mining/blob/master/auth.py

Google

Create project

  1. Sign into your Google Apps account in your browser

  2. Visit https://code.google.com/apis/console#access in the same browser

  3. On the left menu, Create a new Project

  4. To start, you don’t need any Services, so select the API Access tab rom the left menu and “Create an OAuth 2.0 client ID…”

  5. Fill out the Client ID form for a web application and use localhost:8000 as your hostname

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

bottle-auth-0.3.2.tar.gz (23.1 kB view details)

Uploaded Source

File details

Details for the file bottle-auth-0.3.2.tar.gz.

File metadata

  • Download URL: bottle-auth-0.3.2.tar.gz
  • Upload date:
  • Size: 23.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for bottle-auth-0.3.2.tar.gz
Algorithm Hash digest
SHA256 af50b47735d8d89cd56d0cf97c42606af066500e4d376449ee69e771f9d6f0e6
MD5 0a74511afd45f7ddb189a9d98b50024b
BLAKE2b-256 a4b46334f556040646f3421ac93bd158a4c3d1094a16cb91a8c426dbade05574

See more details on using hashes here.

Provenance

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