Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

facebook-javascript-authentication-3.2.0.tar.gz (3.8 kB view details)

Uploaded Source

File details

Details for the file facebook-javascript-authentication-3.2.0.tar.gz.

File metadata

File hashes

Hashes for facebook-javascript-authentication-3.2.0.tar.gz
Algorithm Hash digest
SHA256 c83172aff9c4f1832a70cd2d9f91967e99899bcfde06640dc73613fa7bd955f4
MD5 e527d56a4436fb05a2f1d77a86d30efe
BLAKE2b-256 65898b7f8bce8aff0b6537b4fc50bbbc6c86720a20921366432c4a90504b31e7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page