{ "info": { "author": "Tangent Solutions", "author_email": "admin@tangentsolutions.co.za", "bugtrack_url": null, "classifiers": [], "description": "# PythonAuthenticationLib\n\nA library for authenticating against the UserService\n\n## Installation\n\n\tpip install tangent-tokenauth\n\n## Usage \n\nAdd to installed apps:\n\n```\nINSTALLED_APPS = (\n ...\n 'tokenauth',\n) \n```\n\nAdd to middleware:\n\n```\nMIDDLEWARE_CLASSES = (\n 'django.contrib.sessions.middleware.SessionMiddleware',\n 'django.middleware.common.CommonMiddleware',\n 'django.middleware.csrf.CsrfViewMiddleware',\n 'django.contrib.auth.middleware.AuthenticationMiddleware',\n 'django.contrib.auth.middleware.SessionAuthenticationMiddleware',\n 'django.contrib.messages.middleware.MessageMiddleware',\n 'django.middleware.clickjacking.XFrameOptionsMiddleware',\n 'django.middleware.security.SecurityMiddleware',\n\n 'tokenauth.middleware.TokenAuthMiddleware',\n)\n```\n\n**Add authentication backends**\n\n```\nAUTHENTICATION_BACKENDS = (\n 'django.contrib.auth.backends.ModelBackend',\n\n ## this will allow you to authenticate against the userservice with a token\n 'tokenauth.authbackends.TokenAuthBackend'\n ## this will allow you to authenticate against the userservice with a username and password\n 'tokenauth.authbackends.UserServiceAuthBackend'\n)\n```\n\n**Notes:** It is advisable to include `UserServiceAuthBackend` after `ModelBackend`. \nSince `UserServiceAuthBackend` will sync the user returned from the UserService, it will be preferable to login using the local synced user rather than hitting the UserService each time. \nFrom the frontend this will be transparent. \n\n**Add userservice url**\n\n\tUSERSERVICE_BASE_URL = \"http://example.com\"\n\n**Profit**\n\n\t$$\n\nYou can now authenticate against the UserService: \n\n\tfrom django.contrib.auth.models import User\n\n\t# TokenAuthBackend\n\tuser.authenticate(token)\n\n\t# UserServiceAuthBackend\n\tuser.authenticate(username, password)", "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/TangentMicroServices/PythonAuthenticationLib", "keywords": null, "license": "MIT licence, see LICENCE", "maintainer": null, "maintainer_email": null, "name": "tangent-tokenauth", "package_url": "https://pypi.org/project/tangent-tokenauth/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/tangent-tokenauth/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/TangentMicroServices/PythonAuthenticationLib" }, "release_url": "https://pypi.org/project/tangent-tokenauth/0.1.4/", "requires_dist": null, "requires_python": null, "summary": "Authentication lib for Tangent Micro Services", "version": "0.1.4" }, "last_serial": 1553309, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "5d4d142dd1c60029feaa497963cc4660", "sha256": "b5ec54c8c41dbab1b43e9bee82aa7040ee0bfc69a9f49a9f53352b9bc26a2c30" }, "downloads": -1, "filename": "tangent-tokenauth-0.0.1.tar.gz", "has_sig": false, "md5_digest": "5d4d142dd1c60029feaa497963cc4660", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3913, "upload_time": "2015-05-08T08:43:37", "url": "https://files.pythonhosted.org/packages/90/07/7883d6e453a6020b413a17f04e7d905d905be5ec1e19356fcb2a6ec8d8c9/tangent-tokenauth-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "0994619081d9befad6300a849f88d260", "sha256": "dbafbbeb3c1cb48e6e9b9cc1991be234d65059c86107fadd46450a00ff201db7" }, "downloads": -1, "filename": "tangent-tokenauth-0.0.2.tar.gz", "has_sig": false, "md5_digest": "0994619081d9befad6300a849f88d260", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3962, "upload_time": "2015-05-08T08:46:43", "url": "https://files.pythonhosted.org/packages/60/ff/cb3af6af692decb00be43a440828fb0e9732b6a6e861697ba496d90e581b/tangent-tokenauth-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "6607bb1297807531cce4aa45b2db5d7d", "sha256": "a7af81a7e22dff91a1261325540a8a7bc23637a9f8dcd36a7da8762b1aba1814" }, "downloads": -1, "filename": "tangent-tokenauth-0.0.3.tar.gz", "has_sig": false, "md5_digest": "6607bb1297807531cce4aa45b2db5d7d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3923, "upload_time": "2015-05-08T09:29:54", "url": "https://files.pythonhosted.org/packages/b6/c6/69cbf6531706d620b69bb1df47adda61d49d98783cca8aa2c6ec5255502f/tangent-tokenauth-0.0.3.tar.gz" } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "6c8d8afea41b30ed39b0ccd60ef16224", "sha256": "84c109251e137d2d0892c854801192c5f368064f8c195066f708f1bf95967177" }, "downloads": -1, "filename": "tangent-tokenauth-0.1.0.tar.gz", "has_sig": false, "md5_digest": "6c8d8afea41b30ed39b0ccd60ef16224", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4706, "upload_time": "2015-05-08T09:34:53", "url": "https://files.pythonhosted.org/packages/be/2a/a776b430e6dce0d37af23ef37256f70229a7d46b9b5d968a9e45749b1a10/tangent-tokenauth-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "dcc60bc62ba5c0e57c98eca9b8dfcb9d", "sha256": "d1589c5a1bc48737e92cec142d51697665f15cf7f52abb118aaa4545c26547f0" }, "downloads": -1, "filename": "tangent-tokenauth-0.1.1.tar.gz", "has_sig": false, "md5_digest": "dcc60bc62ba5c0e57c98eca9b8dfcb9d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4703, "upload_time": "2015-05-11T16:13:40", "url": "https://files.pythonhosted.org/packages/ed/58/ec03ae95976f9a49b37175a602f5353440dd8430b357d6e4468be7f26054/tangent-tokenauth-0.1.1.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "0ee0218fd4c5230c9dd2ca244327efd3", "sha256": "41e6b22a1f8da6ad194bb73165289d3ac1108b4c10cd0751622a5d6b1bb0a474" }, "downloads": -1, "filename": "tangent-tokenauth-0.1.3.tar.gz", "has_sig": false, "md5_digest": "0ee0218fd4c5230c9dd2ca244327efd3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4705, "upload_time": "2015-05-11T20:49:35", "url": "https://files.pythonhosted.org/packages/72/74/3c90a2617708fdde10305b1ecf51b3d78de249739f40dfda6f3b539459a0/tangent-tokenauth-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "c770ee4c989d3f410d505e9bf4bddf68", "sha256": "488653b0cd1835d63e2660db1c0a82c0854d371bebe148dd5d176f7fafc6188f" }, "downloads": -1, "filename": "tangent-tokenauth-0.1.4.tar.gz", "has_sig": false, "md5_digest": "c770ee4c989d3f410d505e9bf4bddf68", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4702, "upload_time": "2015-05-19T16:24:21", "url": "https://files.pythonhosted.org/packages/ae/c9/8b7773b47d45c20647e1377d0ded5facb4b91751d08fb94ca02f88256fcf/tangent-tokenauth-0.1.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c770ee4c989d3f410d505e9bf4bddf68", "sha256": "488653b0cd1835d63e2660db1c0a82c0854d371bebe148dd5d176f7fafc6188f" }, "downloads": -1, "filename": "tangent-tokenauth-0.1.4.tar.gz", "has_sig": false, "md5_digest": "c770ee4c989d3f410d505e9bf4bddf68", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4702, "upload_time": "2015-05-19T16:24:21", "url": "https://files.pythonhosted.org/packages/ae/c9/8b7773b47d45c20647e1377d0ded5facb4b91751d08fb94ca02f88256fcf/tangent-tokenauth-0.1.4.tar.gz" } ] }