{ "info": { "author": "Uli Fouquet and the Zope Community", "author_email": "uli@gnufix.de", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Web Environment", "Framework :: Zope3", "Intended Audience :: Developers", "License :: OSI Approved :: Zope Public License", "Operating System :: OS Independent", "Programming Language :: Python" ], "description": "megrok.login\n************\n\nSetting up session based login screens for your Grok-based webapps\nmade easy.\n\nWith ``megrok.login`` you can setup a \"Pluggable Authentication\nUtility\" (PAU) automatically, whenever an instance of a\n``grok.Application`` is put into the ZODB. The most notable effect is,\nthat you will have a login screen instead of the basic-auth\nauthentication when users try to access protected views.\n\nTo enable your users to login via a login screen instead of\nbasic-auth, it is sufficient to create and install an application like\nthis::\n\n import grok\n import megrok.login\n\n class App(grok.Application, grok.Container):\n \"\"\"An application.\n \"\"\"\n megrok.login.enable()\n\nSee detailed documentation below for details on finetuning\nauthentication with ``megrok.login``.\n\n\nInstallation\n============\n\n1) Add `megrok.login` to the dependencies in your ``setup.py``.\n\n2) Run::\n\n $ ./bin/buildout\n\n3) Use ``megrok.login`` in your code.\n\n\nDetailed Documentation\n**********************\n\n\nmegrok.login\n************\n\nSetting up login pages for your web app made easy.\n\nWith `megrok.login` you can setup simple session based login pages\nfor your ``grok.Application`` and other ``grok.Site`` instances. This\nis different to out-of-the-box behaviour, where authentication happens\nby basic-auth.\n\nIntroduction\n============\n\nHere we sketch in short, how you can enable simple session based\nauthentication with ``megrok.login``. More complex examples can\nbe found in the `tests` subdirectory:\n\n* Basic usage:\n\n - ``simple.py``:\n\n How to setup simple(tm) session based authentication with default\n values. This covers the most basic use case.\n\n - ``customlogin.py``:\n\n How to setup session based authentication with your own login page.\n\n - ``autoregister.py``:\n\n How to setup session based authentication so that users can\n register with the site simply by providing a self-chosen password.\n\n - ``strict.py``:\n\n How to setup session based authentication without allowing fallback\n to internal principals which were setup by ZCML at startup.\n\n* More advanced stuff:\n\n - ``custompausetup.py``:\n\n How to setup session based authentication with your own setup of\n the ``Pluggable Authentication Utility``.\n\n\nThe ``megrok.login`` directives\n===============================\n\nWhat you can do with ``megrok.login``:\n\n\n``megrok.login.enable()``\n-------------------------\n\nEnables session based authentication. This marker directive *must* be\nused in order to use ``megrok.login`` functionality. It can be set on\nany `grok.Site` class::\n\n import grok\n import megrok.login\n class MyApp(grok.Application, grok.Container):\n megrok.login.enable()\n\nIf no other ``megrok.login`` directive is used, it enables session\nbased authentication (login screens instead of basic-auth).\n\n``megrok.login.viewname()``\n-------------------------------------\n\nRegisters the view with the name ```` as login page. This\nway you can specify your own login page. You must also use\n``megrok.login.enable()`` to make this work::\n\n import grok\n import megrok.login\n \n class MyApp(grok.Application, grok.Container):\n megrok.login.enable()\n megrok.login.viewname('login')\n\n class Login(grok.View):\n def render(self):\n\n def update(self, camefrom=None, SUBMIT=None):\n self.camefrom=camefrom\n if SUBMIT is not None and camefrom is not None:\n # The credentials were entered. Go back. If the entered\n # credentials are not valid, another redirect will happen\n # to this view.\n self.redirect(camefrom)\n return\n\nwhereas the template for the login view might look like this::\n\n \n \n Login\n \n \n

Custom Login Page

\n
\n
\n \t \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n\nSee ``tests/customlogin.py`` for details.\n\n``megrok.login.strict()``\n-------------------------\n\nNormally, ``megrok.login`` installs two authenticator plugins for your\nsite:\n\n * a normal ``PrincipalFolder``, that can contain principals (users)\n but is empty in the beginning.\n\n * a fallback authenticator, that authenticates against the principals\n of the internal principal registry.\n\nIf you use ``megrok.login.strict()``, the latter is not installed and\nusers like the manager user defined in your site.zcml won't be\naccepted by your login page.\n\nExample::\n\n import grok\n import megrok.login\n class MyApp(grok.Application, grok.Container):\n megrok.login.enable()\n megrok.login.strict()\n\nSee ``tests/strict.py`` for details.\n\n\n``megrok.login.autoregister()``\n-------------------------------\n\nIf this directive is used, the authentication system will register\nautomatically any user that still does not exist on login and add it\nto the ``PrincipalFolder``.\n\nExample::\n\n import grok\n import megrok.login\n\n class ManageApp(grok.Permission):\n grok.name('app.ManageAutoRegister')\n\n class AutoRegisterApp(grok.Application, grok.Container):\n megrok.login.enable()\n # We grant this permission to autoregistered users.\n megrok.login.autoregister('app.ManageAutoRegister')\n\nSee ``tests/autoregister.py`` for details.\n\n\n``megrok.login.setup()``\n----------------------------------\n\nIf you want to setup the Pluggable Authentication Utility (PAU)\nyourself, then you can use this directive. It expects a callable as\nargument, that will be called with an already created PAU instance as\nargument as soon as an application (or other ``grok.Site``) object is\nadded to the ZODB.\n\nSee ``tests/custompausetup.py`` for details.\n\n\n\n\nmegrok.login changes\n********************\n\n0.4 (2011-02-09)\n==================\n\n* Update dependencies/imports to stay compatible with Grok 1.3. No\n more zope.app.\\* dependencies.\n\n .. warning:: This version is not compatible with Grok < 1.3!\n\n Note that starting with this release you have to register session\n support manually, like this in your ``configure.zcml``:\n\n \n\n This is not needed, if you use ``z3c.autoinclude`` and have some\n ``includeDependencies`` directive in your ``configure.zcml``.\n\n* Added (optional) ``loginForm.html`` view to replace the one yet\n provided by `zope.app.authentication`.\n\n .. note:: To activate the included ``loginForm.html`` you have to\n include the ``megrok.login.loginpage.zcml`` **explicitly**. Add\n a snippet like this in your ``configure.zcml``:\n\n \n\n If you define your own login page, this step is not needed.\n\n\n0.3 (2010-07-03)\n================\n\n* Support for Grok 1.1, 1.2. \n\n We now use zope.pluggableauth and friends if available. Note, that\n if you run into problems like non-found authentication adapters, you\n might have to add `zope.app.authentication` manually in your\n project. You can do so by adding::\n\n \n\n in your projects' `configure.zcml`.\n\n If you use ``includeDependencies`` in your projects'\n ``configure.zcml`` (which is most likely true for all projects based\n on `grokproject`, it should be sufficient to depend on\n `megrok.login` in your project's ``setup.py``, as the\n ``configure.zcml`` of `megrok.login` now includes\n ``zope.app.authentication`` for you.\n\n* Default PAU setup now does not include 'No Challenge if\n Authenticated' authenticator plugin anymore. Using this plugin in a\n pipe of authenicators, already authenticated users that entered a\n still forbidden page got ``Unauthorized`` errors instead of being\n redirected to the login page.\n\n Note that this new behaviour applies only to applications newly\n created. If you have some older applications setup with an older\n version of `megrok.login`, you have to modify the authenticator\n plugins of your already setup PAU manually, for instance using the\n ZMI.\n\n\n0.2 (2009-12-09)\n================\n\n* Changed utility setup to reflect changes in Grok API: eventually use\n `IUtilitySetup` instead of `grokcore.meta.setupUtility`. Thanks go to\n Simon Jagoe.\n\n* Changed the test configuration to handle the new grok.View permission.\n\n* Added the versions.cfg file from grok. \n\n\n0.1 (2008-12-26)\n================\n\n(initial version)\n\n\nDownload\n********", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://pypi.python.org/pypi/megrok.login", "keywords": "zope3 zope login grok security PAU", "license": "ZPL 2.1", "maintainer": null, "maintainer_email": null, "name": "megrok.login", "package_url": "https://pypi.org/project/megrok.login/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/megrok.login/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://pypi.python.org/pypi/megrok.login" }, "release_url": "https://pypi.org/project/megrok.login/0.4/", "requires_dist": null, "requires_python": null, "summary": "Providing login screens for your Grok apps made easy.", "version": "0.4" }, "last_serial": 794644, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "7117d30f5f87e145bef9a44594783821", "sha256": "6bea1aaacc0bc361ffc5c20a30a3ef52ad8e48a9570d21a01d23740e2c8fdfa6" }, "downloads": -1, "filename": "megrok.login-0.1.tar.gz", "has_sig": false, "md5_digest": "7117d30f5f87e145bef9a44594783821", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13602, "upload_time": "2008-12-26T16:56:26", "url": "https://files.pythonhosted.org/packages/ef/6c/24102f2db9e2a7da6a1f4463bacae710674df572dafe3f0f9b0012d3da5f/megrok.login-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "28d570e899951d1568852f00732b361b", "sha256": "b421e5758a36b8e027c89db95529b0a2d56b0cd4389a86b4740e177a0aecc6e7" }, "downloads": -1, "filename": "megrok.login-0.2.tar.gz", "has_sig": false, "md5_digest": "28d570e899951d1568852f00732b361b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15477, "upload_time": "2009-12-09T23:12:24", "url": "https://files.pythonhosted.org/packages/25/01/eaa7ba7da4771c6afe03b741e80bc5581cb175729ad3df9c03321524c591/megrok.login-0.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "206f17ccaf62b1935ad76839c3ce5252", "sha256": "7144651d3785882748f5b35a461d0f1143bf741b31041641a8722967856779e9" }, "downloads": -1, "filename": "megrok.login-0.3.tar.gz", "has_sig": false, "md5_digest": "206f17ccaf62b1935ad76839c3ce5252", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19790, "upload_time": "2010-07-03T15:31:36", "url": "https://files.pythonhosted.org/packages/fb/b1/099a754c28f012994e1816e055b290120ec73aafd8b76480e284b4c4ca64/megrok.login-0.3.tar.gz" } ], "0.4": [ { "comment_text": "", "digests": { "md5": "836c38b042f97c0a27c3e5ef046b5208", "sha256": "a354b8ce0ca47b1fae1c7ae03fd4d633f42b58d08e00da114ecb3a26ab56d117" }, "downloads": -1, "filename": "megrok.login-0.4.tar.gz", "has_sig": false, "md5_digest": "836c38b042f97c0a27c3e5ef046b5208", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21209, "upload_time": "2011-02-09T14:55:52", "url": "https://files.pythonhosted.org/packages/68/64/8091c8b341d71768651f35394c90678277869a3d27913c1564f2d4b1c0eb/megrok.login-0.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "836c38b042f97c0a27c3e5ef046b5208", "sha256": "a354b8ce0ca47b1fae1c7ae03fd4d633f42b58d08e00da114ecb3a26ab56d117" }, "downloads": -1, "filename": "megrok.login-0.4.tar.gz", "has_sig": false, "md5_digest": "836c38b042f97c0a27c3e5ef046b5208", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21209, "upload_time": "2011-02-09T14:55:52", "url": "https://files.pythonhosted.org/packages/68/64/8091c8b341d71768651f35394c90678277869a3d27913c1564f2d4b1c0eb/megrok.login-0.4.tar.gz" } ] }