Skip to main content

bottle-auth

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

Release files for bottle-auth 0.3.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bottle-auth 0.3.3
File Size Uploaded
bottle-auth-0.3.3.tar.gz 23.1 kB Details

Release files / bottle-auth-0.3.3.tar.gz

Download URL bottle-auth-0.3.3.tar.gz
Size 23.1 kB
Tags Source
SHA-256 checksum
How to use checksums
01ebb491e1a6b940716d24e7cbf860d02384fc82df0e1c76607fa1bf1c377385
BLAKE2b-256 checksum
How to use checksums
dfc0b9c959780b4f228c09d70bf25e93f586477f29bc8bbc6969d3d243784602
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.3.3 This release

1 release file

0.3.2

1 release file

0.3.1

1 release file

0.3.0

1 release file

0.2.3

1 release file

0.1.2

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page