{ "info": { "author": "Sam Alba", "author_email": "sam.alba@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "Basic OAuth v2\n==============\n\nWhat is it?\n-----------\n\nThe Oauth v2 spec defines several authorization grant. This library implements\nthe \"Resource Owner Password Credentials Grant\" as described in\n\n\nRequirements:\n\n* [Flask](http://flask.pocoo.org/)\n* [Redis](http://redis.io/)\n\nWhy using it?\n-------------\n\nThe goal of this Grant is to replace the classic \"HTTP Basic over SSL\" widely\nused. With Oauth, you exchange your crendentials against a token.\n\nThis mechanism has several advantages:\n\n* The client does not pass the full credentials for each request.\n* The server does not check the username and password each time, it will \n only check the access token, this will reduce the database lookups.\n\nBasic Oauth uses Redis to store the sessions.\n\nIs it secure?\n-------------\n\n__It would be stupid to use this mechanism without SSL__. Even if the token is\npassed instead of the credentials, the credentials needs to be passed in clear\ntext during the Authentication phase. Also, it can be problematic to lose the\ntoken.\n\nTo limit the risk of losing the token, every single token generated is signed\nusing the User-Agent and the client IP address. If an attacker tries to re-use\na stolen token, he will have to connect to the same IP and using the same\nUser-Agent (browser version, OS, architecture) to get access. A wrong try will\nresult in destroying the session.\n\nHow to use it?\n--------------\n\nInstall basic_oauth from PYPI:\n\n```\npip install basic_oauth\n```\n\nCreate a sample WSGI app with [Flask](http://flask.pocoo.org/):\n\n```python\nimport flask\nimport basic_oauth\n\napp = flask.Flask(__name__)\n\noauth = basic_oauth.BasicOauth(app)\noauth.mount_endpoint('login', '/login')\noauth.mount_endpoint('script', '/js/oauth_client.js')\noauth.credentials.append(('johndoe', 'foobar42'))\n# You can declare \"oauth.authenticate_handler\" to plug your own\n# database instead of using the in-memory credentials\n\n@app.route('/')\n@oauth.require\ndef hello(user_id):\n return 'Hello World!'\n\nif __name__ == '__main__':\n app.debug = True\n app.run()\n```\n \nCheckout the [\"example\" directory](https://github.com/samalba/basic_oauth/tree/master/example) for a complete server/client example.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/samalba/basic_oauth", "keywords": null, "license": "Copyright (c) 2012 Samuel Alba \n\nPermission is hereby granted, free of charge, to any person obtaining a copy \nof this software and associated documentation files (the \"Software\"), to deal \nin the Software without restriction, including without limitation the rights \nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell \ncopies of the Software, and to permit persons to whom the Software is \nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all \ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR \nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, \nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE \nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER \nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE \nSOFTWARE.", "maintainer": null, "maintainer_email": null, "name": "basic_oauth", "package_url": "https://pypi.org/project/basic_oauth/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/basic_oauth/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://github.com/samalba/basic_oauth" }, "release_url": "https://pypi.org/project/basic_oauth/0.1.5/", "requires_dist": null, "requires_python": null, "summary": "Implements the \"Resource Owner Password Credentials Grant\" from Oauth v2.", "version": "0.1.5" }, "last_serial": 786723, "releases": { "0.1.1": [ { "comment_text": "", "digests": { "md5": "c82636666d21dcf67b4ca3bac05358d5", "sha256": "f3708cecd811c652f54e6c94251c180f7c208e2ab45addcdd805683fc92cb865" }, "downloads": -1, "filename": "basic_oauth-0.1.1.tar.gz", "has_sig": false, "md5_digest": "c82636666d21dcf67b4ca3bac05358d5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5005, "upload_time": "2012-09-03T23:35:10", "url": "https://files.pythonhosted.org/packages/f4/e8/182bf767a630bbb0bacbfd7d23111518ed265a172ff6a32e2d332167caaa/basic_oauth-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "9b9853ad558683e0f1d6e9adbd1f6ccb", "sha256": "20bc1ef5018634537f80465e78a45f560515ace61848c782c82e838e9f28bf72" }, "downloads": -1, "filename": "basic_oauth-0.1.2.tar.gz", "has_sig": false, "md5_digest": "9b9853ad558683e0f1d6e9adbd1f6ccb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5186, "upload_time": "2012-09-15T17:40:40", "url": "https://files.pythonhosted.org/packages/9f/ff/9fb811ac128e96302ae8af6758c9ac51f5b6d4590843a0e9ba10e7c07e0e/basic_oauth-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "09e865deb954642873e28be00508d56f", "sha256": "82fdf812b60f46aa1c1f4acbec31f2e0ae41d229cd00fd25cefa5d704d761795" }, "downloads": -1, "filename": "basic_oauth-0.1.3.tar.gz", "has_sig": false, "md5_digest": "09e865deb954642873e28be00508d56f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5224, "upload_time": "2012-09-17T00:53:46", "url": "https://files.pythonhosted.org/packages/87/1a/3d78618aed76171675b1a8cc7b66223893194377e8a1a0779eab23e55e7c/basic_oauth-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "553dde20894e719e49e193d126dc53e5", "sha256": "a1719c1c8472d2a846a12223df4177af2f8fbed7445d652f6c60ea7b0706ab52" }, "downloads": -1, "filename": "basic_oauth-0.1.4.tar.gz", "has_sig": false, "md5_digest": "553dde20894e719e49e193d126dc53e5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5263, "upload_time": "2012-09-19T04:18:48", "url": "https://files.pythonhosted.org/packages/d8/54/3641c37a64a6952c12741cc0f01dae2c4b5bb8cd1690f088653702d70b33/basic_oauth-0.1.4.tar.gz" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "f5534204902df1670a3dfa810bdd6cc6", "sha256": "44d0aef33128a170e35f4c7fc713df0d6b317fe9737117c8e2e41804e5e20fc0" }, "downloads": -1, "filename": "basic_oauth-0.1.5.tar.gz", "has_sig": false, "md5_digest": "f5534204902df1670a3dfa810bdd6cc6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5300, "upload_time": "2012-09-24T01:54:00", "url": "https://files.pythonhosted.org/packages/1b/95/f408e33ad8d6fa6d1aa57a6e87f486d6e56f9174185d16c94d595e16f564/basic_oauth-0.1.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f5534204902df1670a3dfa810bdd6cc6", "sha256": "44d0aef33128a170e35f4c7fc713df0d6b317fe9737117c8e2e41804e5e20fc0" }, "downloads": -1, "filename": "basic_oauth-0.1.5.tar.gz", "has_sig": false, "md5_digest": "f5534204902df1670a3dfa810bdd6cc6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5300, "upload_time": "2012-09-24T01:54:00", "url": "https://files.pythonhosted.org/packages/1b/95/f408e33ad8d6fa6d1aa57a6e87f486d6e56f9174185d16c94d595e16f564/basic_oauth-0.1.5.tar.gz" } ] }