{ "info": { "author": "Ahmet Kotan", "author_email": "ahmtkotan@gmail.com", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Framework :: Django", "Framework :: Django :: 1.10", "Framework :: Django :: 1.11", "Framework :: Django :: 1.8", "Framework :: Django :: 1.9", "Intended Audience :: Developers", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Internet :: WWW/HTTP", "Topic :: Internet :: WWW/HTTP :: Dynamic Content" ], "description": "=====================================================================\n Tokenauth\n=====================================================================\nTokenauth developed for django rest token authentication. It enables you to define expiration time and token prefix. Tokens generate with random data and it use SHA-256 algorithm.\n\nInstallation\n============\non Pypi\n::\n pip install tokenauth\non Github\n::\n git clone git@github.com:ahmetkotan/tokenauth.git\n cd tokenauth\n python setup.py install\n\nSettings\n============\nAdded to `INSTALLED_APPS`.\n::\n\n INSTALLED_APPS = [\n ...\n 'tokenauth',\n ...\n ]\n\nAdded to `urls.py`.\n::\n urlpatterns = [\n ...\n url(r'^/', include('tokenauth.urls')),\n ...\n]\n\nDefinition in `settings.py`\n::\n TOKEN_EXPIRATION_TIME = 60 * 60 * 24 * 3 # Default 3 days\n TOKEN_PREFIX = \"Bearer\"\n TOKEN_REFRESH = True\n\nUsage\n=====\nDefinition in `settings.py`\n::\n # Rest Framework\n REST_FRAMEWORK = {\n ...\n 'DEFAULT_AUTHENTICATION_CLASSES': (\n 'tokenauth.auth.TokenAuthentication',\n ),\n ...\n }\n\nOr in `views.py`\n::\n from tokenauth.auth import TokenAuthentication\n class SimpleView(ModelViewset):\n authentication_classes = (TokenAuthentication, )\n\n\nCreated token and login:\n::\n curl -X POST -H \"Content-Type: application/json\" -d '{\"username\": \"\", \"password\":\"\"}' //tokens/\n\nRefresh token:\n::\n curl -X PUT -H \"Content-Type: application/json\" -d '{\"key\": \"\"}' //tokens/\n\nDeleted token and logout:\n::\n curl -X DELETE -H \"Content-Type: application/json\" -H \"Authorization: \" //tokens/", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/ahmetkotan/tokenauth", "keywords": "", "license": "GPL", "maintainer": "", "maintainer_email": "", "name": "tokenauth", "package_url": "https://pypi.org/project/tokenauth/", "platform": "", "project_url": "https://pypi.org/project/tokenauth/", "project_urls": { "Homepage": "https://github.com/ahmetkotan/tokenauth" }, "release_url": "https://pypi.org/project/tokenauth/0.9.1/", "requires_dist": null, "requires_python": "", "summary": "Django Simple Token Auth with Expiration Time and Prefix", "version": "0.9.1" }, "last_serial": 4746032, "releases": { "0.9.1": [ { "comment_text": "", "digests": { "md5": "2705d3252f206a6feb4f2a9bd901cd57", "sha256": "0f732eefa401ccef227e311cdcc6719a9838f276f223fe32ac79e12146b32d49" }, "downloads": -1, "filename": "tokenauth-0.9.1.tar.gz", "has_sig": false, "md5_digest": "2705d3252f206a6feb4f2a9bd901cd57", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4379, "upload_time": "2019-01-27T12:54:40", "url": "https://files.pythonhosted.org/packages/c5/35/dd3553917c4b5e06bcf8cbc574111442bacdd098e677c117d5bc38c3fe3c/tokenauth-0.9.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "2705d3252f206a6feb4f2a9bd901cd57", "sha256": "0f732eefa401ccef227e311cdcc6719a9838f276f223fe32ac79e12146b32d49" }, "downloads": -1, "filename": "tokenauth-0.9.1.tar.gz", "has_sig": false, "md5_digest": "2705d3252f206a6feb4f2a9bd901cd57", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4379, "upload_time": "2019-01-27T12:54:40", "url": "https://files.pythonhosted.org/packages/c5/35/dd3553917c4b5e06bcf8cbc574111442bacdd098e677c117d5bc38c3fe3c/tokenauth-0.9.1.tar.gz" } ] }