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

Metadata

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 Provenance Actions
bottle-auth-0.3.3.tar.gz 23.1 kB Without provenance Details for bottle-auth-0.3.3.tar.gz

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

Security for bottle-auth 0.3.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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