{ "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-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\n\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-client", "keywords": "", "license": "GPL v2.0", "maintainer": "", "maintainer_email": "", "name": "dj-sso-client2", "package_url": "https://pypi.org/project/dj-sso-client2/", "platform": "", "project_url": "https://pypi.org/project/dj-sso-client2/", "project_urls": { "Homepage": "https://github.com/tofu0913/dj-sso-client" }, "release_url": "https://pypi.org/project/dj-sso-client2/0.24/", "requires_dist": null, "requires_python": "", "summary": "A Django SSO client application, works with dj-sso-server", "version": "0.24" }, "last_serial": 4804421, "releases": { "0.22": [ { "comment_text": "", "digests": { "md5": "6967a7f5d9927af3dd7444e1af2a9dae", "sha256": "f277e90d7dbbee721a892ac1fdd70fcc1c4147442c544622727f60771495b4c4" }, "downloads": -1, "filename": "dj-sso-client2-0.22.tar.gz", "has_sig": false, "md5_digest": "6967a7f5d9927af3dd7444e1af2a9dae", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19085, "upload_time": "2016-08-17T03:39:55", "url": "https://files.pythonhosted.org/packages/ee/ca/d920f3270bf857442bce3b69a9f57e3619924c517931833565585ddd44a8/dj-sso-client2-0.22.tar.gz" } ], "0.23": [ { "comment_text": "", "digests": { "md5": "e0598c9fb1515435ec565b6d5c8e912f", "sha256": "2df1549fc7ed881eaa445c864d85ee7a48ee207aa09acb21ae2576bbd506e602" }, "downloads": -1, "filename": "dj-sso-client2-0.23.tar.gz", "has_sig": false, "md5_digest": "e0598c9fb1515435ec565b6d5c8e912f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19169, "upload_time": "2016-08-24T09:19:58", "url": "https://files.pythonhosted.org/packages/c0/cf/e3d5a484598dc5f246237857b0a5fe657eedc6b68e68f49774eb79165a36/dj-sso-client2-0.23.tar.gz" } ], "0.24": [ { "comment_text": "", "digests": { "md5": "7822fca54be2818fcb62b539ff04abd9", "sha256": "daca9a76b1d9a7ffd14d09f7e92ed797b1ad38659f0fa124d0d877f1262008a2" }, "downloads": -1, "filename": "dj-sso-client2-0.24.tar.gz", "has_sig": false, "md5_digest": "7822fca54be2818fcb62b539ff04abd9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21208, "upload_time": "2019-02-11T06:43:52", "url": "https://files.pythonhosted.org/packages/c4/72/54affdbb8ae505d7ed2e23e28b7cfc0d31fc0c7e2c52d9c6ebfcf7e969d8/dj-sso-client2-0.24.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "7822fca54be2818fcb62b539ff04abd9", "sha256": "daca9a76b1d9a7ffd14d09f7e92ed797b1ad38659f0fa124d0d877f1262008a2" }, "downloads": -1, "filename": "dj-sso-client2-0.24.tar.gz", "has_sig": false, "md5_digest": "7822fca54be2818fcb62b539ff04abd9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21208, "upload_time": "2019-02-11T06:43:52", "url": "https://files.pythonhosted.org/packages/c4/72/54affdbb8ae505d7ed2e23e28b7cfc0d31fc0c7e2c52d9c6ebfcf7e969d8/dj-sso-client2-0.24.tar.gz" } ] }