{ "info": { "author": "Fan Fei", "author_email": "feifan.pub@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-client\n=============\n``dj-sso-client`` is the a Django application works as SSO client side of ``dj-sso-server`` (https://github.com/feifangit/dj-sso-server)\n\n\nInstallation\n-------------\n``pip install dj-sso-client``\n\n\n\nAdd to your project\n------------------------\n- Modify following settings in ``settings.py`` of your project\n\n\t- ``AUTHENTICATION_BACKENDS``, add ``djssoclient.authbackend.SSOAuthBackend`` as the backends\n\t- ``AUTH_USER_MODEL``, set ``djssoclient.SSOUser`` as user model\n\n.. code-block:: python\n\n\tAUTHENTICATION_BACKENDS = ('djssoclient.authbackend.SSOAuthBackend',)\n\tAUTH_USER_MODEL = 'djssoclient.SSOUser'\n\n- Add following ``dj-sso-client`` settings base on your demand\n\n\t- ``SSO_API_AUTH_SETTING``: set API key, SEC key and remote SSO provider URL. This setting is used by underneath ``dj-api-auth`` module to proejct API accessing.\n\n\t\t.. code-block:: python\n\n\t\t\tSSO_API_AUTH_SETTING = {\n\t\t\t \"apikey\": \"f4a05287\",\n\t\t\t \"seckey\": \"6a4eeaea54d54f51af703e79c6096d51\",\n\t\t\t \"url\": \"https://dj-sso-sample.herokuapp.com\",\n\t\t\t}\n\n\t- ``SSO_REMOTE_URL_PREFIX`` (optional): SSO path in remote SSO provider. default ``/sso/``\n\n\t- ``SSO_USER_STORAGE``(optional): SSOUser storage solution, there are 2 storage backends in ``dj-sso-client`` already. default: SSOUserDBStorage\n\n\t\t- ``djssoclient.userstorage.SSOUserDBStorage``: store user data in database\n\t\t- ``djssoclient.userstorage.SSOUserCacheStorage``: store user data in cache. You will get better performance.\n\n\t- ``SSO_SETTING_CACHE`` (optional): if you selected ``SSOUserCacheStorage`` as your user storage backend, and you have more than one cache in ``settings.py``, you can pick up the cache name here. default: ``default``\n\n\nAttention: ``SSOUserCacheStorage``\n---------------------------------------\nThe default ``django.core.cache.backends.locmem.LocMemCache`` stores data per process. In multi-process production environment (gunicorn on multi-core server), it may cause problem while using ``SSOUserCacheStorage`` as your user storage engine. \n\nPlease use dedicate cache system (Memcached or Redis) as cache backend to avoid this problem.\n\n\nSSOUser\n--------\n``SSOUser`` is the user model to store user data. It can be used as database model class if you selected ``SSOUserDBStorage`` to be your user storage engine.\n\n.. code-block:: python\n\t\n\tclass SSOUser(AbstractBaseUser):\n\t username = models.CharField(unique=True, max_length=50)\n\t extras = models.TextField(default=\"{}\")\n\t ...\n\n**extra user attributes** : attributes not exists in the ``SSOUser`` class. (attributes except ``username``, ``password``, ``last_login`` etc.) \n\nAll extra user attributes can be access by ``getattr`` method or ``.`` operator. And they are stored in class member ``extras`` in JSON format.\n\n\nGet your hands dirty\n---------------------\nWe already have a SSO provider (``dj-sso-server``) application running on Heroku: http://dj-sso-sample.herokuapp.com/ . Run the example application in folder ``example/ssoclient/`` locally.\n\nThe API key using in the example application is binding with ``localhost:8000``, so make sure you're accessing local application by ``localhost:8000`` rather than the ``127.0.0.1:8000``. \n\n**fresh login**\n\n1. make sure you're not logged in on http://dj-sso-sample.herokuapp.com/, you should see ``please log in with ...``\n2. click *sso login* on local application, you will be redirected to http://dj-sso-sample.herokuapp.com/sso/....\n3. you will see user information after be redirected to local application.\n4. on http://dj-sso-sample.herokuapp.com/ , your status is still not logged-in\n\n**login with existing logged account**\n\n1. log in with user name ``user1`` and password ``123`` on http://dj-sso-sample.herokuapp.com/ \n2. click *sso login* on local application, you will be redirected to http://dj-sso-sample.herokuapp.com/sso/...., but you will see a different login page with fresh login. \n3. select ``continue with current user? user1``\n4. you will be logged in as ``user1`` at local application\n\n**switch account**\n\n1. if you select ``switch account`` and login with ``user2``/``456`` from step 3 in previous sample\n2. you will be logged in as ``user2`` at local application\n3. your login status on http://dj-sso-sample.herokuapp.com/ will **NOT** be changed (still logged in as ``user1``)\n\n\n\nTODO\n-----\n- example: work as an extra auth method", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/feifangit/dj-sso-client", "keywords": null, "license": "GPL v2.0", "maintainer": null, "maintainer_email": null, "name": "dj-sso-client", "package_url": "https://pypi.org/project/dj-sso-client/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/dj-sso-client/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/feifangit/dj-sso-client" }, "release_url": "https://pypi.org/project/dj-sso-client/0.21/", "requires_dist": null, "requires_python": null, "summary": "A Django SSO client application, works with dj-sso-server", "version": "0.21" }, "last_serial": 1673816, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "1551b9f6946d9307bdabb803ddb1d9c6", "sha256": "cb1127799c2e8b57bb84678ff0c6ac2237db681fdf3cbb9baba216f8f50a1092" }, "downloads": -1, "filename": "dj-sso-client-0.1.tar.gz", "has_sig": false, "md5_digest": "1551b9f6946d9307bdabb803ddb1d9c6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 30360, "upload_time": "2015-03-12T00:17:40", "url": "https://files.pythonhosted.org/packages/da/e9/a74738376ce4216adce5e035df6bd4a623af953191d24884089c180aeb05/dj-sso-client-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "835db1d807e71bd78b6811d082f5ba84", "sha256": "e2113a1204b301a0557eca76af30d9cd8e56dca6aa8d6fb44992e994520558ed" }, "downloads": -1, "filename": "dj-sso-client-0.2.tar.gz", "has_sig": false, "md5_digest": "835db1d807e71bd78b6811d082f5ba84", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 30357, "upload_time": "2015-04-22T21:51:24", "url": "https://files.pythonhosted.org/packages/7e/25/90c405137d9b598c25abfc5786af69cb7f30d9195b88571e9cfd286f52a8/dj-sso-client-0.2.tar.gz" } ], "0.21": [ { "comment_text": "", "digests": { "md5": "db71096625ef8cc476998763ca1a499e", "sha256": "af66c3a7564dbda5766e48294468404d5e5b23ce19c4a006d5e894043098d18a" }, "downloads": -1, "filename": "dj-sso-client-0.21.tar.gz", "has_sig": false, "md5_digest": "db71096625ef8cc476998763ca1a499e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 30344, "upload_time": "2015-08-12T00:16:47", "url": "https://files.pythonhosted.org/packages/3f/5d/c1714b913f17920e757627ac2d3f9fefbceead0d15b6c4f27c57c8869b09/dj-sso-client-0.21.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "db71096625ef8cc476998763ca1a499e", "sha256": "af66c3a7564dbda5766e48294468404d5e5b23ce19c4a006d5e894043098d18a" }, "downloads": -1, "filename": "dj-sso-client-0.21.tar.gz", "has_sig": false, "md5_digest": "db71096625ef8cc476998763ca1a499e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 30344, "upload_time": "2015-08-12T00:16:47", "url": "https://files.pythonhosted.org/packages/3f/5d/c1714b913f17920e757627ac2d3f9fefbceead0d15b6c4f27c57c8869b09/dj-sso-client-0.21.tar.gz" } ] }