{ "info": { "author": "PressPass Developers", "author_email": "tyler@newscatalyst.org", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# Social Auth PressPass\n\n`Social Auth PressPass` provides backend and pipeline implementations for using [PressPass](https://presspass.it) with [Python Social Auth](https://github.com/python-social-auth/social-core). It is available on PyPI as `social-auth-presspass`, and the primary module import is `social_auth_presspass`.\n\nWhen a user logs into your application with PressPass, you will receive a list of the organizations that allow the user to access your app on their behalf.\n\n## General Installation\n\nRegardless of your web framework (or lack thereof), there are a few key steps you need to take to start using Social Auth PressPass.\n\n#### Create a PressPass app\n\nCreate a PressPass app using the developer dashboard. The name, price, and access controls are all up to you. Then, make sure of the following in the OpenID Connect section:\n\n* **Response types** must include `Authorization Code Flow` (`code`), as this is how Social Auth PressPass with authenticate with PressPass itself.\n\n* **Client type** must be set to `Public`. (No, this doesn't mean that anyone will be able to log in; it means that client authentication tokens are cryptographically signed by PressPass itself.)\n\n* **Redirect URIs** must include both the development URL and production URL of your application login callback. If you installed Social Auth under the `auth/` path in Django, this might look like `http://localhost:8000/auth/complete/presspass/`. You can add additional paths on each line. Wildcards are not supported, so be exact!\n\n#### Link your application\n\nIn your settings (in Django, this is your `settings.py` file), set `SOCIAL_AUTH_PRESSPASS_KEY` to your application's **client ID** from the PressPass developer dashboard.\n\n> From here, you're ready to go! Now you can integrate the PressPass backend into your app just as you would any other Python Social Auth backend. That being said, this can sometimes be tricky, so we've included a Django quickstart below.\n\n## Django Installation\n\n1. Install `social-auth-presspass` and `django-social-auth` from PyPI, and follow all the instructions above (in General Installation). You should also follow `django-social-auth`'s setup instructions, though you can augment them to fit your use case with the following steps.\n\n2. Add the PressPass auth backend to your `SOCIAL_AUTH_AUTHENTICATION_BACKENDS` setting in `settings.py`. This will probably look like the following:\n\n```python\nSOCIAL_AUTH_AUTHENTICATION_BACKENDS = (\n 'social_auth_presspass.backends.PressPassBackend',\n)\n```\n\n3. Add the PressPass backend as a Django Authentication Backend. To do this, change the following setting:\n\n```python\nAUTHENTICATION_BACKENDS = (\n 'social_auth_presspass.backends.PressPassBackend',\n ...\n)\n```\n\nIf you still want to allow some users to log in with a username and password (or if you want to use the Admin Panel login system), be sure to keep Django's built-in `ModelBackend` in `AUTHENTICATION_BACKENDS`:\n\n```python\nAUTHENTICATION_BACKENDS = (\n 'social_auth_presspass.backends.PressPassBackend',\n 'django.contrib.auth.backends.ModelBackend',\n)\n```\n\n4. If you want information about a user's organizations, add the PressPass pipelines to your social auth pipelines:\n\n```python\nSOCIAL_AUTH_PIPELINE = (\n ...\n 'social_auth_presspass.pipelines.extract_organizations',\n 'social_auth_presspass.pipelines.link_organizations_to_session',\n ...\n)\n```\n\nNote that you should probably put these pipelines _after_ the `social_details`, `social_uid`, and `auth_allowed` built-in pipelines. Note also that you don't _need_ to include `link_organizations_to_session` unless you would like to access a user's PressPass organizations from inside their session without using their `user_information` (that is, if you're even keeping track of users).\n\n## Backends\n\nThis package provides only one backend, `social_auth_presspass.backends.PressPassBackend`. It inherits from the Python Social Auth OpenID Connect backend, and can be used like any other social auth backend.\n\n#### User Details\n\nThis backend provides the `presspass_organizations` user detail automatically, which is a list containing information about the organizations that the user is both 1) a member of and 2) has access to the app on behalf of. The key fields in each organization are `uuid` and `name`.\n\n## Pipelines\n\nThis package provides one pipeline, `social_auth_presspass.pipelines.link_organizations_to_session`, which is intended to help apps leverage the PressPass authentication system _in lieu_ of their own. This pipeline creates two **session variables** for the PressPass-authenticated visitor:\n\n* `presspass_authenticated`: `True` if the visitor has been authenticated with PressPass (we recommend you use this as `session.get('presspass_authenticated', False))`, as there is no guarantee that this value is defined and non-null.\n\n* `presspass_organizations`: a list of organizations the visitor is authorized to access your app as a member of (each organization is a dict serialized from data returned from PressPass itself). If a visitor hasn't authenticated with PressPass, this value will not be set. All authenticated visitors will be a member of at least one organization (even if that organization is just an auto-generated personal one).\n\n## Examples\n\nFor an example app that uses this package for authentication (in lieu of its own user-management system), check out [OpenAlerts](https://github.com/news-catalyst/openalerts).\n\n## License\n\nThis package is licensed under the MIT License (see `LICENSE`).\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/news-catalyst/social-auth-presspass", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "social-auth-presspass", "package_url": "https://pypi.org/project/social-auth-presspass/", "platform": "", "project_url": "https://pypi.org/project/social-auth-presspass/", "project_urls": { "Homepage": "https://github.com/news-catalyst/social-auth-presspass" }, "release_url": "https://pypi.org/project/social-auth-presspass/0.2.0/", "requires_dist": null, "requires_python": ">=3.6", "summary": "PressPass backend and pipelines for the popular Python Social Auth libraries", "version": "0.2.0", "yanked": false, "yanked_reason": null }, "last_serial": 6013760, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "1cc2ef593a8e12c46944116faa22bf5b", "sha256": "18e75b9885c7a726b61b7d16009ac5011ac8e6d06f91831dac7bcd61a6192047" }, "downloads": -1, "filename": "social_auth_presspass-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "1cc2ef593a8e12c46944116faa22bf5b", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 4192, "upload_time": "2019-10-22T15:07:48", "upload_time_iso_8601": "2019-10-22T15:07:48.014313Z", "url": "https://files.pythonhosted.org/packages/13/c1/1a25cb42d56e5805249456b9010534d4eb085672e34f648e6052e18cf919/social_auth_presspass-0.1.0-py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "1ff57060ae5c5a07eeb0dee397039d5d", "sha256": "0a34f5faf3b08bfd04b5bab3182e5067269bf19f7409927431eed2177446381b" }, "downloads": -1, "filename": "social-auth-presspass-0.1.0.tar.gz", "has_sig": false, "md5_digest": "1ff57060ae5c5a07eeb0dee397039d5d", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 1558, "upload_time": "2019-10-22T15:07:49", "upload_time_iso_8601": "2019-10-22T15:07:49.999100Z", "url": "https://files.pythonhosted.org/packages/67/ca/b6a6dd7707ab1742e1c39de510847af80a438a05ac29ab5056d4da29ea4c/social-auth-presspass-0.1.0.tar.gz", "yanked": false, "yanked_reason": null } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "014047b74436970e0b7c74982542f8f2", "sha256": "128c1c85da9b15ce3b533510e0ef979d9a606d75a43388ded6b1480e5de79b57" }, "downloads": -1, "filename": "social_auth_presspass-0.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "014047b74436970e0b7c74982542f8f2", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 6320, "upload_time": "2019-10-22T15:58:19", "upload_time_iso_8601": "2019-10-22T15:58:19.310407Z", "url": "https://files.pythonhosted.org/packages/4c/46/edf2379b339ebfb670bb733544c66eb3569b44be8499412502055bf6ac79/social_auth_presspass-0.2.0-py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "5ffd588b0f4a0fdf93e1c553358b4912", "sha256": "e1eee318ebd8f062e77bd5e3a62e0b00f38ad124906e6468dec9b2af7140db05" }, "downloads": -1, "filename": "social-auth-presspass-0.2.0.tar.gz", "has_sig": false, "md5_digest": "5ffd588b0f4a0fdf93e1c553358b4912", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 3955, "upload_time": "2019-10-22T15:58:20", "upload_time_iso_8601": "2019-10-22T15:58:20.875286Z", "url": "https://files.pythonhosted.org/packages/d1/c3/92debf916f8df4fac239266b7aaae74d543a100f522d8b0b0103d2e18e77/social-auth-presspass-0.2.0.tar.gz", "yanked": false, "yanked_reason": null } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "014047b74436970e0b7c74982542f8f2", "sha256": "128c1c85da9b15ce3b533510e0ef979d9a606d75a43388ded6b1480e5de79b57" }, "downloads": -1, "filename": "social_auth_presspass-0.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "014047b74436970e0b7c74982542f8f2", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 6320, "upload_time": "2019-10-22T15:58:19", "upload_time_iso_8601": "2019-10-22T15:58:19.310407Z", "url": "https://files.pythonhosted.org/packages/4c/46/edf2379b339ebfb670bb733544c66eb3569b44be8499412502055bf6ac79/social_auth_presspass-0.2.0-py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "5ffd588b0f4a0fdf93e1c553358b4912", "sha256": "e1eee318ebd8f062e77bd5e3a62e0b00f38ad124906e6468dec9b2af7140db05" }, "downloads": -1, "filename": "social-auth-presspass-0.2.0.tar.gz", "has_sig": false, "md5_digest": "5ffd588b0f4a0fdf93e1c553358b4912", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 3955, "upload_time": "2019-10-22T15:58:20", "upload_time_iso_8601": "2019-10-22T15:58:20.875286Z", "url": "https://files.pythonhosted.org/packages/d1/c3/92debf916f8df4fac239266b7aaae74d543a100f522d8b0b0103d2e18e77/social-auth-presspass-0.2.0.tar.gz", "yanked": false, "yanked_reason": null } ], "vulnerabilities": [] }