{ "info": { "author": "Cory Dolphin", "author_email": "wcdolphin@gmail.com", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Internet :: WWW/HTTP :: Dynamic Content", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "Flask-OlinAuth\r\n==============\r\n\r\nFlask-OlinAuth implements OlinApps auth. It automatically provides a\r\n``/olinauthlogin`` and ``/olinauthlogout`` route to the application,\r\nhandling the process of actually authenticating a user with olinapps.\r\n\r\nAt a high level, Flask-OlinAuth provides two useful pieces for your\r\napplication, both of which are demonstrated in ``example.py``.\r\n\r\n``@auth_required``\r\n------------------\r\n\r\nA simple function decorator which ensures that a user is logged in\r\nbefore a view is shown. The user is redirected to the login portal, with\r\ncorrect arguments, if not.\r\n\r\n``current_user``\r\n----------------\r\n\r\nA nice local proxy for all of your views to get the current user,\r\nformatted as a dictionary.\r\n\r\n``logout_user``\r\n---------------\r\n\r\nWill log out the currently authenticated user, allowing you to simply\r\ncreate your own logout view.\r\n\r\nFlask-OlinAuth is very heavily inspired by Flask-Login, with structure,\r\nand functionality adopted, and much knowledge gained.\r\n\r\nInstallation\r\n------------\r\n\r\nInstall the extension with one of the following commands:\r\n\r\n::\r\n\r\n $ easy_install flask-olinauth\r\n\r\nor alternatively if you have pip installed (which you should):\r\n\r\n::\r\n\r\n $ pip install flask-olinauth\r\n\r\nExample Usage\r\n-------------\r\n\r\n::\r\n\r\n from flask import Flask, url_for\r\n from flask.ext.olinauth import OlinAuth, auth_required, current_user\r\n app = Flask(__name__)\r\n\r\n SECRET_KEY = \"yeah, not actually a secret\"\r\n DEBUG = True\r\n\r\n app.config.from_object(__name__)\r\n\r\n oa = OlinAuth(app, 'localhost:5000')\r\n #initial OlinAuth, with callback host of localhost:5000, for local server\r\n oa.init_app(app, 'localhost:5000')\r\n\r\n\r\n @app.route(\"/\")\r\n def index():\r\n if current_user:\r\n responseString = \"Awesome index, guess what? %s is logged in. Sweet, right?\" % current_user['id']\r\n else:\r\n responseString = \"It is kind of lonely here... No users are logged in. Checkout my secret \" % url_for('secret')\r\n return responseString\r\n\r\n\r\n @app.route(\"/secret\")\r\n @auth_required\r\n def secret():\r\n return \"I wouldn't normally show you this, but since %s is logged in, here is the secret: 42\" % current_user['id']\r\n\r\n\r\n if __name__ == \"__main__\":\r\n app.run(debug=True)", "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/wcdolphin/flask-olinauth", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "Flask-OlinAuth", "package_url": "https://pypi.org/project/Flask-OlinAuth/", "platform": "any", "project_url": "https://pypi.org/project/Flask-OlinAuth/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/wcdolphin/flask-olinauth" }, "release_url": "https://pypi.org/project/Flask-OlinAuth/1.0.1/", "requires_dist": null, "requires_python": null, "summary": "A simple Flask extension implementing Olin's authentication", "version": "1.0.1" }, "last_serial": 784321, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "9c5f7642cd63002345ddc2dd56331064", "sha256": "c1c3f43bcc0c2361fb597fa24cc9885b49bcca7346d267a20cba56df1a5d34d8" }, "downloads": -1, "filename": "Flask-OlinAuth-1.0.win32.exe", "has_sig": false, "md5_digest": "9c5f7642cd63002345ddc2dd56331064", "packagetype": "bdist_wininst", "python_version": "any", "requires_python": null, "size": 203500, "upload_time": "2013-02-02T22:19:07", "url": "https://files.pythonhosted.org/packages/73/35/b8201668222fa2cf1e7dcdef521b98d7c07677b105c9fcbc20bf015a11ee/Flask-OlinAuth-1.0.win32.exe" }, { "comment_text": "", "digests": { "md5": "1ae9a94c3c1cbcb96247d759aae06de0", "sha256": "f18c33d703da86884364033980c48603e4e7191bb9cdfeea2e10200ed8404e25" }, "downloads": -1, "filename": "Flask-OlinAuth-1.0.zip", "has_sig": false, "md5_digest": "1ae9a94c3c1cbcb96247d759aae06de0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8326, "upload_time": "2013-02-02T22:19:05", "url": "https://files.pythonhosted.org/packages/34/06/3f3690469091111ed654ed0abaa40be718d8335889a9456a12151f37288a/Flask-OlinAuth-1.0.zip" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "d2b0ebc92c0c817d7f860383caf18ae5", "sha256": "41decca287bc9db1b0ff8786041e79f4d118538830554f4ea2e74737a31808f7" }, "downloads": -1, "filename": "Flask-OlinAuth-1.0.1.win32.exe", "has_sig": false, "md5_digest": "d2b0ebc92c0c817d7f860383caf18ae5", "packagetype": "bdist_wininst", "python_version": "any", "requires_python": null, "size": 203476, "upload_time": "2013-02-05T17:51:30", "url": "https://files.pythonhosted.org/packages/f0/6c/1baf2699c0731090d6db11538758e70c398a89c80e19bcf1e80393dff599/Flask-OlinAuth-1.0.1.win32.exe" }, { "comment_text": "", "digests": { "md5": "580c3ecfe5dc99bf620c7bd65aa8b24c", "sha256": "e6b454b9cedcd2231ef4a2f37a54e1976598f219f3d9997fe8a27b1f488d545e" }, "downloads": -1, "filename": "Flask-OlinAuth-1.0.1.zip", "has_sig": false, "md5_digest": "580c3ecfe5dc99bf620c7bd65aa8b24c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8253, "upload_time": "2013-02-05T17:51:28", "url": "https://files.pythonhosted.org/packages/84/1d/60c0c0bf4a745ae7c1c89b1a361fe16d497accd02f6b990eb519ca584056/Flask-OlinAuth-1.0.1.zip" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "d2b0ebc92c0c817d7f860383caf18ae5", "sha256": "41decca287bc9db1b0ff8786041e79f4d118538830554f4ea2e74737a31808f7" }, "downloads": -1, "filename": "Flask-OlinAuth-1.0.1.win32.exe", "has_sig": false, "md5_digest": "d2b0ebc92c0c817d7f860383caf18ae5", "packagetype": "bdist_wininst", "python_version": "any", "requires_python": null, "size": 203476, "upload_time": "2013-02-05T17:51:30", "url": "https://files.pythonhosted.org/packages/f0/6c/1baf2699c0731090d6db11538758e70c398a89c80e19bcf1e80393dff599/Flask-OlinAuth-1.0.1.win32.exe" }, { "comment_text": "", "digests": { "md5": "580c3ecfe5dc99bf620c7bd65aa8b24c", "sha256": "e6b454b9cedcd2231ef4a2f37a54e1976598f219f3d9997fe8a27b1f488d545e" }, "downloads": -1, "filename": "Flask-OlinAuth-1.0.1.zip", "has_sig": false, "md5_digest": "580c3ecfe5dc99bf620c7bd65aa8b24c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8253, "upload_time": "2013-02-05T17:51:28", "url": "https://files.pythonhosted.org/packages/84/1d/60c0c0bf4a745ae7c1c89b1a361fe16d497accd02f6b990eb519ca584056/Flask-OlinAuth-1.0.1.zip" } ] }