UNKNOWN
Project description
facebook-javascript-authentication is a Django application that manages user authentication via Facebook using the JavaScript Facebook SDK and django-facebook-auth application ( https://github.com/pozytywnie/django-facebook-auth )
Installation
Package
facebook-javascript-authentication can be installed as a normal Python package.
Example instalation for pip:
$ pip install facebook-javascript-authentication
Configuration
settings.py
Set USE_TZ = True
Add facebook_javascript_authentication to INSTALLED_APPS:
INSTALLED_APPS = ( ... 'facebook_javascript_authentication', ... )
Add javascript authentications urls to application urls:
urlpatterns = patterns('', ... url(r'^facebook_javascript_authentication/', include('facebook_javascript_authentication.urls')), ... )
Add script.js in html template head:
... <script type="text/javascript" src="{{ STATIC_URL }}facebook_javascript_authentication/script.js"></script> ...
Add updating isAuthenticated variable on facebook user status change to FB.init block:
{% load facebook_javascript_sdk %} {% fb_init_block %} ... updateIsAuthenticatedOnFBStatusChanged(); ... {% endblock %}
Usage
loginDialog
To show user login dialog with email permissions:
loginDialog(successCallback, 'email')
isAuthenticated variable
Variable isAuthenticated is set to current user status on each facebook ‘auth.statusChange’ event.
Custom login source
If you have a user access token then you can try authenticate him by calling:
login(access_token, successCallbackFunction)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Hashes for facebook-javascript-authentication-3.2.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | d48e7020c66fdc5c35e51ec87fd3d47dbb5f7df96e475857344e8cc87825f095 |
|
MD5 | 8df8efcdabd8e8792fa7b57f1c6c5045 |
|
BLAKE2b-256 | d1ed45413115fc4d633bbe5c171df3e2e99891d7591410c5a73a6e86055fcbfc |