Skip to main content

Introduction

A PAS plugin to login into a Plone Site using Facebook.

  • Log in to a Plone site through Facebook: when a user requests to log in to the Plone site he will be redirected to Facebook so that he provides the credentials there, then he will be redirected back to the Plone site and will be identified there.

  • The user will be a standard Plone user, so Roles or Group membership can be set.

  • Minimal user information is kept in Plone such as full name, Facebook ID, photo and e-mail (if available) of the user. This is kept to avoid permanent requests to Facebook API. This information is refreshed each time the user logs in to the site.

Installation and getting started

  1. Buildout

    Add cs.auth.facebook to your buildout.cfg eggs list:

    [buildout]
    ...
    eggs =
        cs.auth.facebook

    Or as a required install dependency of your own addon setup.py:

    install_requires=[
        ...
        'cs.auth.facebook',
    ],
  2. Create a new Facebook app at https://developers.facebook.com/app and fill in the required data in the plugin’s control panel form.

  3. Install the product in the Plone Control Panel and provide the app_id and app_secret in the configuration panel.

    Now you see the “Facebook Login” button viewlet. To customize the placement of this viewlet please check out the Plone Viewlet Documentation

  4. Alternatively you can enable an action in portal_actions with the following configuration (see profiles/default/actions.xml within this package):

    <object name="portal_actions" meta_type="Plone Actions Tool"
       xmlns:i18n="http://xml.zope.org/namespaces/i18n">
        <object name="user" meta_type="CMF Action Category">
            <object name="login_facebook" meta_type="CMF Action" i18n:domain="cs.auth.facebook">
                <property name="title" i18n:translate="">Log in with Facebook</property>
                <property name="description" i18n:translate=""></property>
                <property name="url_expr">string:${globals_view/navigationRootUrl}/@@facebook-login</property>
                <property name="icon_expr"></property>
                <property name="available_expr">python:member is None</property>
                <property name="permissions">
                    <element value="View"/>
                </property>
                <property name="visible">False</property>
            </object>
        </object>
    </object>

Behind the scenes

The Facebook Login Viewlet uses the new Facebook JavaScript SDK v4.0 to ensure the proper popup for every target device. You don’t have to care about this.

For more information on FB JSDK checkout the Facebook Developers Login Documentation

Credit

This product re-distributes a lot of code written by Martin Aspeli (aka @optilude) in his book “Professional Plone 4 Development” and available under GPL license in his personal GitHub account with the name ‘optilux.facebookauth’:

https://github.com/optilude/optilux/tree/chapter-16/src/optilux.facebookauth

Compatibility

Plone 4.x Plone 5.x

Changelog

1.2 (2019-10-09)

  • Updated to Facebook API 4.0 [sarn0ld]

1.1 (2017-05-10)

  • Facebook Login with JavaScript SDK v2.1 [petschki]

  • add Facebook Login Viewlet [petschki]

  • disable old style portal_action by default. code is still there (see documentation) [petschki]

  • Fix access_token processing

  • Remove Welcome message

1.1b1 (2014-10-22)

1.0.3 (2014-10-21)

  • Add german translation [petschki]

  • Encoding unicode user credentials. see http://goo.gl/63Kyuo for more info [petschki]

1.0.2 (2014-10-10)

  • Fix dependencies includes [erral]

1.0.1 (2014-10-10)

  • Fix docs [erral]

1.0 (2014-10-10)

  • Fix user search [erral]

  • Fix to be able to add the plugin through the ZMI [erral]

1.0b2 (2012-10-16)

  • FaceBook users are now PloneUsers [erral]

  • Implement user search in storage [erral]

  • Get properties from self data storage instead of relying on Session [erral]

  • Change user action name not to clash with Plone’s login [erral]

1.0b1 (2012-07-13)

  • Initial release [erral]

Metadata

Release files for cs.auth.facebook 1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cs.auth.facebook 1.2
File Size Uploaded Provenance Actions
cs.auth.facebook-1.2.tar.gz 22.0 kB Without provenance Details for cs.auth.facebook-1.2.tar.gz

Release files / cs.auth.facebook-1.2.tar.gz

Download URL cs.auth.facebook-1.2.tar.gz
Size 22.0 kB
Tags Source
SHA-256 checksum
How to use checksums
51a71186e047054788ff4f72572c987078cafb02d4e8943851a9ccbd3f01bbb5
BLAKE2b-256 checksum
How to use checksums
5e88201c92f520c062cb684d9bb9a4cd7f99fa9ae8aa0fd11368eae5268456fb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/2.7.15+

Security for cs.auth.facebook 1.2

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