Package: pas.plugins.authomatic
OAuth2 / OpenId Authentication in PloneFeaturespas.plugins.authomaticprovides OAuth2 and OpenID login capability for Plone sites by integrating the awesomeAuthomaticpackage.Authomatic is a framework agnostic library
for Python web applications
with a minimalistic but powerful interface
which simplifies authentication of users
by third party providers like Facebook or Twitter
through standards like OAuth and OpenID.by author Peter Hudec on Authomatic websiteSupported ProvidersOut of the box,pas.plugins.authomaticsupports the following providersOAuth 1.0aBitbucketFlickrMeetupPlurkTwitterTumblrUbuntuOneVimeoXeroXingYahooOAuth 2.0AmazonBehanceBitlyCosmDeviantARTEventbriteFacebookFoursquareGitHubGoogleLinkedInPayPalRedditViadeoVKWindowsLiveYammerYandexOpenIDpython-openidGoogle App Engine based OpenID.DocumentationThis package supports Plone sites using Volto or the Classic UI.For the Classic UI:This package creates a view calledauthomatic-handlerwhere you can login with different providers.The view can be used as well to add an identity from a provider to an existing account.The provider is choosen in the URL so if you call/authomatic-handler/PROVIDERyou will use PROVIDER to login.For Volto:Endpoint@loginwith GET: Returns list of authentication optionsEndpoint@login-authomaticwith GET: Provide information to start the OAuth process.Endpoint@login-authomaticwith POST: Handles OAuth login and returns a JSON web token (JWT).For Volto sites you must also install@plone-collective/volto-authomatic.Configuration is, currently, done via Classic UI:Plugin configuration is available in the Controlpanel@@authomatic-controlpanel(linked under users)Example JSON configuration (first level key is the PROVIDER):{"github":{"display":{"title":"Github","cssclasses":{"button":"plone-btn plone-btn-default","icon":"glypicon glyphicon-github"},"as_form":false},"propertymap":{"email":"email","link":"home_page","location":"location","name":"fullname"},"class_":"authomatic.providers.oauth2.GitHub","consumer_key":"5c4901d141e736f114a7","consumer_secret":"d4692ca3c0ab6cc1f8b28d3ccb1ea15b61e7ef5c","access_headers":{"User-Agent":"Plone Authomatic Plugin"}},}InstallationAddpas.plugins.authomaticto the Plone installation usingpip:pipinstallpas.plugins.authomaticor add it as a dependency on your package'ssetup.pyinstall_requires=["pas.plugins.authomatic","Products.CMFPlone","plone.restapi","setuptools",],Start Plone and activate the plugin in the addons control-panel.ConfigurationUsing Classic UI, go to theAuthomaticcontrolpanel.Configuration parameters for the different authorization are provided as JSON text in there. We use JSON because of its flexibility.Details about the configuration of each provider can be found atAuthomatic provider section.There are some differences in configuration:Value of"class_"has to be a string, which is then resolved as a dotted path.Each provider can get an optional entrydisplaywith sub-enties such as:titlewhich is used in the templates instead of the section name.iconclasseswhich is applied in the templates to an span.buttonclasseswhich is applied in the templates to the button.as_form(true/false) which renders a form for OpenId providers.Each provider can get an optional entrypropertymap.
It is a mapping from authomatic/provider user properties to plone user properties, like"fullname": "name",. Look at each providers documentation which properties are available.Source Code and ContributionsIf you want to help with the development (improvement, update, bug-fixing, ...) ofpas.plugins.authomaticthis is a great idea!Issue TrackerSource CodePlease do larger changes on a branch and submit a Pull Request.Creator ofpas.plugins.authomaticis Jens Klein.We appreciate any contribution and if a release is needed to be done on PyPI, please just contact one of us.DevelopmentYou need a workingpythonenvironment (system, virtualenv, pyenv, etc) version 3.7 or superior.Then install the dependencies and a development instance using:makebuildTo run tests for this package:maketestBy default we use the latest Plone version in the 6.x series.LicenseThe project is licensed under the GPLv2.Changelog1.2.0 (2023-09-13)Add Spanish translation. @macaguaBetter handle values from identity data. @cekkAddusername_useridUser ID factory. @ericofAnnotate transaction in POST calls to authenticate a user. @ericof1.1.2 (2023-03-15)Support Python 3.11 for Plone 6. @ericofLint fixes @ericof1.1.1 (2022-10-14)Upgrade plone/code-analysis-action to version 2. @ericofFix packaging issue related to CHANGELOG.md not being included in the source package. @ericofSupport Python 3.10 for Plone 6. @ericof1.1.0 (2022-10-10)Add the plone.restapi adapter to show the controlpanel in Volto. @erralAdd possibility to redirect tonext_urlvia provided cookie @avoinea1.0.0 (2022-07-25)Use plone/plone-setup GitHub Action. @ericofAdd Brazilian Portuguese translation. @ericofUse plone/code-analysis-action GitHub Action for code analysis. @ericofFix doChangeUser takes 2 positional arguments but 3 were given @avoinea1.0b2 (2021-08-18)Fix tox setup, move CI from TravisCI to GitHub Actions. @jensensCode Style Black, Isort, zpretty and Pyupgrade applied. @jensensAdd missing no-op methods for IUserManagement to plugin.
This fixes the tests. @jensensDrop Python 2 support and so require Plone 5.2. @jensensInclude permissions from CMFCore to avoid ComponentLookupError. @bsuttorFixed ModuleNotFoundError: No module named 'App.class_init' on Zope 5. @bsuttorAdd french translation @mpeetersPAS event notification IPrincipalCreatedEvent. @jensensPython 3 and Plone 52 compatibility. @cekkFix #44: Fullfill strictly exact_match when enumerating users @allusaAllow users deletion. @cekkDrop Plone < 5.1.x compatibility. @cekkFix #54: Notification of PrincipalCreated event. @ericofCloses #55: Support plone.restapi. @ericof1.0b1 (2017-11-20)Slighly beautify login modal. @jensensFix #33" Page does not exist Control Settings. @jensensFix #31: Link is broken to JSON configuration documentation in help text. @jensensFix #28: After uninstall plone.external_login_url is still registered and the login broken. @jensensSupport for Plone 5.1 tested (worked, ust control-panel icon needed some tweak).
Buildout configuration for 5.1 added. @jensensInstall: Hide non-valid profiles at install form. @jensensAdditional checks to ensure to never have an empty/None key stored. @jensensFix #27: Update user data after login. @jensensFix filter users bug in enumerateUsers plugin where it was always returning
all the users. @sneridaghfix typo and wording of login message @tkimnguyen1.0a7 (2016-02-15)Workaround for None users. @sneridagh1.0a6 (2016-01-11)Fix #21: When you logout and then login again, a new user is created. @jensens1.0a5 (2015-12-04)Fix: #18 "Provider Login" option for "Generator for Plone User ID" seems
broken @jensensFix: Title indicates if an identity is added @jensensFix: Correct usage of plone.protect @jensens1.0a4 (2015-11-20)Added german translation @jensensRestored Plone 4 compatibility @keulAdded italian translation @keulProper uninstall @keul1.0a3 (2015-11-15)Refactor authomatic-handler to enable adding identities. @jensensFix: use secret from settings as secret for Authomatic. @jensensRenamed viewauthomatic-logintoauthomatic-handler, because this
view will be used to add an identity too (url must be registered on provider
side sometimes and we want to do this only once). @jensens1.0a2 (2015-11-14)Minimal validation of JSON. @jensensMake the wholerememberprocedure asafeWriteif called from login
view. We can not pass a authenticator token here, because of redirects and
expected return urls . @jensensAllow selection of user id generator strategy. @jensensAllow multiple services for one user. This changes a lot behind the scenes. @jensensUse authomatic.core.User attributes instead of raw provider data. closes#9@ericof1.0a1 (2015-10-28)Initial release.