https://github.com/avelino/bottle-auth
Bootle authentication, for Personal, Google, Twitter and facebook
https://github.com/avelino/bottle-auth
Last synced: 4 months ago
JSON representation
Bootle authentication, for Personal, Google, Twitter and facebook
- Host: GitHub
- URL: https://github.com/avelino/bottle-auth
- Owner: avelino
- License: mit
- Created: 2014-03-15T02:07:51.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2017-02-19T18:04:14.000Z (over 8 years ago)
- Last Synced: 2025-03-17T21:42:35.412Z (4 months ago)
- Language: Python
- Homepage: https://pypi.python.org/pypi/bottle-auth
- Size: 372 KB
- Stars: 29
- Watchers: 6
- Forks: 12
- Open Issues: 6
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
bottle-auth
===========Bottle plugin authentication, support with Google, Twitter and Facebook
Example
-------.. code-block:: python
from bottle import Bottle, request, run
from bottle.ext import auth
from bottle.ext.auth.decorator import login
from bottle.ext.auth.social.facebook import Facebook
from pprint import pformatfacebook = Facebook('fb-key', 'fb-secret',
'http://127.0.0.1:3333/', 'email')app = Bottle()
plugin = auth.AuthPlugin(facebook)
app.install(plugin)@app.route('/')
@login()
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/mining/auth.py `_
------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
--------Create project
++++++++++++++1. Sign into your Facebook account in your browser
2. Visit `https://developers.facebook.com/ `_ in the same browser
3. Click Apps > Create a New App in the navigation bar
4. Enter Display Name, then choose a category, then click Create app
5. Fill out the Client ID form for a **web application** and use *localhost:8000* as your hostname