{ "info": { "author": "Fan Fei, Cliff Chen", "author_email": "tofu0913@gmail.com", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License v2 (GPLv2)", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Topic :: Internet :: WWW/HTTP", "Topic :: Internet :: WWW/HTTP :: Dynamic Content" ], "description": "dj-sso-server\n==============\n``dj-sso-server`` is a Django application that provides Single Sign-on feature for your project.\n\nThe ``dj-sso-server`` application works as a **SSO provider** , you can use ``dj-sso-client`` (https://github.com/tofu0913/dj-sso-client) as the **SSO client** in other projects need SSO.\n\n\nInstallation\n------------\nInstall by command ``pip install dj-sso-server``\n\nThe dependent package ``dj-api-auth`` (https://github.com/feifangit/dj-api-auth) will be installed automatically. \n\n\nHow it works\n-------------\n- Based on the ``dj-api-auth`` module, we can create an API key with SSO related APIs initially included. All the API communications between ``dj-sso-server`` and ``dj-sso-client`` are protected by ``dj-api-auth``\n- The API key will also be bind with a **host** which is used to limit the origin of SSO requests. \n- SSO work flow with ``dj-sso-client``\n\n\t1. Firstly, ``dj-sso-client`` applies a **request key** via API ``reqeusttoken/`` on ``dj-sso-server``\n\t2. The **request key** in ``dj-sso-server`` side will be kept in cache for 5 minutes, so the whole SSO login process should be done in 5 minutes.\n\t3. With the **request key**, ``dj-sso-client`` redirects user to SSO login page on SSO provider, and get **auth token** if login success. ``dj-sso-server`` will \n\n\t\t- verify the request origin\n\t\t- verify **request key** validity (expired?)\n\t\t- save user information in cache \n\n\t4. ``dj-sso-client`` verifies the **auth token** with ``dj-sso-server`` via API ``authtoken/``, and get a ``SSOUser`` object. \n\t5. ``dj-sso-server`` delete the **request key** from cache once the ``authtoken/`` is called.\n\n- If there's an already logged-in account on ``dj-sso-server`` (say, the project where SSO provider is placed also provides other features, and there's a valid cookies in browser side and valid session on server side), user can select to continue with that logged account.\n- SSO login through ``dj-sso-server`` with not affect the login status on ``dj-sso-server``.\n\n\nAttention\n----------\nSince **request keys** are stored in cache waiting for verification or expiration. If you have multiple application process running in your deployment (gunicorn etc.), please use proper cache system that can be shared between processes. \n\nMemcached and Redis are both great for caching, be aware, the **Local-memory caching** (``django.core.cache.backends.locmem.LocMemCache``) is a toy for local debugging.\n\n\nAdd ``dj-sso-server`` to project\n--------------------------------\n1. Add ``djapiauth`` and ``djssoserver`` to ``INSTALLED_APPS`` in ``sttings.py``\n2. Assign an URL to the module\n\n.. code-block:: python\n\t\n\t# add auth for a browser-oriented view\n\turl(r'^sso/', include(\"djssoserver.urls\"))\n\t#...\n\n\nSettings\n--------\n- **SSO_SERVER_USER_TO_JSON_FUNC**\n\t- optional, a path to function receives an user object and return a json string.\n\t- the default ``SSO_SERVER_USER_TO_JSON_FUNC`` function is ``djssoserver.utility.default_user_to_json``\n\n\t\t.. code-block:: python\n\t\t\t\n\t\t\tdef default_user_to_json(user):\n\t\t\t return json.dumps(model_to_dict(user, exclude=[\"password\", \"user_permissions\"]), \n\t\t\t cls=DjangoJSONEncoder)\n\nScan API\n---------\nIn order to discover and manage APIs, after ``dj-sso-server`` is added in an accessible ``urls.py``, run command ``python manage.py reloadentrypoints`` to collect APIs to database.\n\n\nCreate API key for SSO\n-----------------------\n1. From your admin site, create an API key at ``Single sign-on/SSO credential``. All SSO related APIs will assigned to this API Key automatically.\n2. After the API key for SSO is ready, you can assign more APIs for this API key at ``API Auth/Credential`` from admin site\n\n\nCustomize SSO login page\n------------------------\nYou can add styles to your own SSO login page. simply create ``djsso/ssologin.html`` under the ``templates`` folder. Revamp it by imitating the \n`original page \n`_\n\n\nSSOUser object\n---------------\n``dj-sso-client`` gets a ``SSOUser`` object whatever the User model is used in SSO provider project.\n\nSee detail in README file of ``dj-sso-client`` (https://github.com/tofu0913/dj-sso-client)\n\n\n\nDEMO\n-----\nWe have a SSO provider application running on Heroku (https://dj-sso-sample.herokuapp.com/).\n\n**Source code**: under ``example`` folder\n\nTo try the demo out, check out the README file of ``dj-sso-client`` (https://github.com/tofu0913/dj-sso-client)\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/tofu0913/dj-sso-server", "keywords": "", "license": "GPL v2.0", "maintainer": "", "maintainer_email": "", "name": "dj-sso-server2", "package_url": "https://pypi.org/project/dj-sso-server2/", "platform": "", "project_url": "https://pypi.org/project/dj-sso-server2/", "project_urls": { "Homepage": "https://github.com/tofu0913/dj-sso-server" }, "release_url": "https://pypi.org/project/dj-sso-server2/0.7/", "requires_dist": null, "requires_python": "", "summary": "A Django SSO provider application", "version": "0.7" }, "last_serial": 3860173, "releases": { "0.6": [ { "comment_text": "", "digests": { "md5": "24ce0f45bd6cdd0a7c9d201c95f0a91f", "sha256": "fa8df48d703e87b5f8e00e262586212855fe1d1038a306d70fa31b56f31c23fd" }, "downloads": -1, "filename": "dj-sso-server2-0.6.tar.gz", "has_sig": false, "md5_digest": "24ce0f45bd6cdd0a7c9d201c95f0a91f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21633, "upload_time": "2016-07-21T06:39:19", "url": "https://files.pythonhosted.org/packages/b4/c6/be0cb9cc0a20f801a9904a7b524a239ee1e8c29797bc764b6130ee9d6318/dj-sso-server2-0.6.tar.gz" } ], "0.7": [ { "comment_text": "", "digests": { "md5": "7889e88abfdf411653b0131e43d1d0d1", "sha256": "ee60fcb4727b7760e47e228b94c6bc5e53d31827e2bb9316b3212c8fba7e85cb" }, "downloads": -1, "filename": "dj-sso-server2-0.7.tar.gz", "has_sig": false, "md5_digest": "7889e88abfdf411653b0131e43d1d0d1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21673, "upload_time": "2018-05-14T09:15:34", "url": "https://files.pythonhosted.org/packages/61/6d/a43512db7e44c2ea41fb6352139612da94cb1bae6db1ecd8051c4fba165d/dj-sso-server2-0.7.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "7889e88abfdf411653b0131e43d1d0d1", "sha256": "ee60fcb4727b7760e47e228b94c6bc5e53d31827e2bb9316b3212c8fba7e85cb" }, "downloads": -1, "filename": "dj-sso-server2-0.7.tar.gz", "has_sig": false, "md5_digest": "7889e88abfdf411653b0131e43d1d0d1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21673, "upload_time": "2018-05-14T09:15:34", "url": "https://files.pythonhosted.org/packages/61/6d/a43512db7e44c2ea41fb6352139612da94cb1bae6db1ecd8051c4fba165d/dj-sso-server2-0.7.tar.gz" } ] }