Facebook Auth support in Kinto
Kinto-facebook enables authentication in Kinto applications using Facebook OAuth2 bearer tokens.
It provides:
An authentication policy class;
Integration with Kinto cache backend for token verifications;
Integration with Kinto for heartbeat view checks;
Some optional endpoints to perform the OAuth dance (optional).
Installation
First of all, create a Facebook Auth app.
You need to grab the client_id, client_secret and app_client_token in the app general settings page:
https://developers.facebook.com/apps/{client_id}/settings/basic/
https://developers.facebook.com/apps/{client_id}/settings/advanced/
Install the Python package:
pip install kinto-facebook
Include the package in the project configuration:
kinto.includes = kinto_facebook
And configure authentication policy using pyramid_multiauth formalism:
multiauth.policies = facebook multiauth.policy.facebook.use = kinto_facebook.authentication.FacebookAuthenticationPolicy
By default, it will rely on the cache configured in Kinto.
Configuration
Fill those settings with the values obtained during the application registration:
facebook.client_id = 89513028159972bc facebook.client_secret = 9aced230585cc0aaea0a3467dd800 facebook.app_access_token = 30ce836499a146428464b28816b1618b facebook.webapp.authorized_domains = * # facebook.cache_ttl_seconds = 300 # facebook.state.ttl_seconds = 3600
In case the application shall not behave as a relier (a.k.a. OAuth dance endpoints disabled):
facebook.relier.enabled = false
If necessary, override default values for authentication policy:
facebook.header_type = Bearer+Facebook
Login flow
OAuth Bearer token
Use the OAuth token with this header:
Authorization: Bearer <access_token>
- notes:
If the token is not valid, this will result in a 401 error response.
Obtain token using Web UI
Navigate the client to GET /facebook/login?redirect=http://app-endpoint/%23. There, a session cookie will be set, and the client will be redirected to a login form on the Facebook content server;
After submitting the credentials on the login page, the client will be redirected to http://app-endpoint/#{token} (the web-app).
Changelog
This document describes changes between each past release.
0.1.0 (2018-03-15)
Initial implementation.
Contributors
Mathieu Leplatre <mathieu@mozilla.com>
Rémy Hubscher <rhubscher@mozilla.com>
Metadata
Release files for kinto-facebook 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| kinto-facebook-0.1.0.tar.gz | 11.0 kB | Without provenance | Details for kinto-facebook-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| kinto_facebook-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for kinto_facebook-0.1.0-py3-none-any.whl |
Total release size: 25.8 kB
Release files / kinto-facebook-0.1.0.tar.gz
| Download URL | kinto-facebook-0.1.0.tar.gz |
|---|---|
| Size | 11.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
325ea9dfc8dc74937544bf897c6e72a04b5d6e0118b0cf3b6427d788898e7012
|
|
BLAKE2b-256 checksum How to use checksums |
b56eb5f1bf468160ed7fc87f8d30d193555cff398fc20bfd6a71e97b5b5b9aa5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / kinto_facebook-0.1.0-py3-none-any.whl
| Download URL | kinto_facebook-0.1.0-py3-none-any.whl |
|---|---|
| Size | 14.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cfbc832091908e71f00e5305dbe5ea050ff669bfde610ca8904fa1a7b0a561d4
|
|
BLAKE2b-256 checksum How to use checksums |
b1b1c39e548a92bf6c801ca70229b993e4d987f16b0a53efd5a9a01898ee0da8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for kinto-facebook 0.1.0
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.