{ "info": { "author": "Emile Fugulin", "author_email": "emilefugulin@hotmail.com", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Framework :: Flask", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Software Development :: Libraries", "Topic :: Utilities" ], "description": "# Flask-Rebar-Auth0\n[![PyPI version](https://badge.fury.io/py/flask-rebar-auth0.svg)](https://badge.fury.io/py/flask-rebar-auth0)\n[![Python versions](https://img.shields.io/pypi/pyversions/Flask-Rebar-Auth0.svg)](https://badge.fury.io/py/flask-rebar-auth0)\n[![Test](https://github.com/Sytten/flask-rebar-auth0/workflows/Test/badge.svg)](https://github.com/Sytten/flask-rebar-auth0)\n[![codecov](https://codecov.io/gh/Sytten/flask-rebar-auth0/branch/master/graph/badge.svg)](https://codecov.io/gh/Sytten/flask-rebar-auth0)\n[![code style](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/Sytten/flask-rebar-auth0/blob/master/LICENSE)\n\nSimple [Flask-Rebar](https://github.com/plangrid/flask-rebar) authenticator for [Auth0](https://auth0.com).\nYour access tokens need to be [JWT tokens](https://auth0.com/docs/api-auth/tutorials/verify-access-token) for this authenticator to work.\n\n## Initialization\n```python\n# Config\napp.config.from_mapping({\n \"AUTH0_ENDPOINT\": \"perdu.auth0.com\", # The Auth0 domain for your tenant\n \"AUTH0_ALGORITHMS\": [\"RS256\"], # The authorized algorithms, you should not have to change it\n \"AUTH0_AUDIENCE\": \"https://api.perdu.com\" # The API Identifier as set on Auth0\n\n \"AUTH0_HEADER_AUTHENTICATION\": True # Use the authentication by header\n \"AUTH0_HEADER_NAME\": \"Authorization\" # (OPTIONAL) Change the header used\n \"AUTH0_HEADER_PREFIX\": \"Bearer\" # (OPTIONAL) Change the prefix used\n # OR\n \"AUTH0_COOKIE_AUTHENTICATION\": True # Use the authentication by cookie\n \"AUTH0_COOKIE_NAME\": \"Some Cookie\" # Name of the cookie containing the access token\n\n \"AUTH0_TESTING\": False # (OPTIONAL) Disable expiration check of tokens during tests \n})\n\n# Create\nauthenticator = Auth0Authenticator(app)\n\n@authenticator.identity_handler\ndef create_user(claims: Dict[str, Any]) -> Any:\n \"\"\"Built a user object from the claims\"\"\"\n return { \"id\": claims[\"sub\"] }\n```\n\n## Usage\n```python\nfrom flask_rebar_auth0 import get_authenticated_user\n\n\n@registry.handles(\n rule=\"/users/me\",\n method=\"GET\",\n marshal_schema=UserSchema(),\n authenticator=authenticator, # Use the authenticator\n)\ndef get_user():\n return get_authenticated_user() # Get the user data created by the identity_handler\n\n\n@registry.handles(\n rule=\"/users/me/location\",\n method=\"GET\",\n marshal_schema=UserLocationSchema(),\n authenticator=authenticator.with_scopes([\"read:location\"]), # Require some scopes to access the ressource\n)\ndef get_user_location():\n user = get_authenticated_user()\n return locationService.get(user)\n```\n\n## Swagger\nIf you wish to use swagger, you will need to register the custom authenticators.\nThis is needed by `rebar` to be able to convert them to the right swagger [security definition](https://swagger.io/docs/specification/2-0/authentication/).\nIf you use the `Cookie` authentication, please note that swagger 2.0 does support this method of authentication. It will be registered as a `Cookie` header.\n```python\nfrom flask_rebar_auth0 import register_authenticators\n\nregister_authenticators(registry)\n```\n\n## Testing\nDuring tests, we suggest setting `AUTH0_TESTING` to `True` to allow expired tokens to be used.\nThe setting also disables the request to auth0 for the keys, you MUST supply them manually.\n```python\nmy_key = {\n \"alg\": \"RS256\",\n \"kty\": \"RSA\",\n \"use\": \"sig\",\n \"x5c\": [\n \"MIIC+TCCAeGgAwIBAgIJFDs6wMv+QZ3IMA0GCSqGSIb3DQEBCwUAMBoxGDAWBgNVBAMTD3BlcmR1LmF1dGgwLmNvbTAeFw0xOTAzMjkwNDM2MDhaFw0zMjEyMDUwNDM2MDhaMBoxGDAWBgNVBAMTD3BlcmR1LmF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pMvmsMvVyUvVGfSiwuukUXHoS_zCsRRvbAJGAx4qVIAutzRiCaZLMnN5Nb10iB-iyQGLGT46a0L865urlH9u7qugXdVZs2Vfu1BLIs00sxlua9rUYyW81bCBMe-D6GxhqScM3o8N9XqZaI1LUQ9pf6P0Z0xrn2RQ\",\n \"e\": \"AQAB\",\n \"kid\": \"OTEyNDRCREE1OTlEOUYwNEM2QTM5RkJEODkxOEQyMDQ0NjYxRENEMw\",\n \"x5t\": \"OTEyNDRCREE1OTlEOUYwNEM2QTM5RkJEODkxOEQyMDQ0NjYxRENEMw\"\n}\n\nauthenticator = Auth0Authenticator(app)\nauthenticator.add_key(my_key)\n```\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/Sytten/flask-rebar-auth0", "keywords": "flask,flask-rebar,auth0", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "flask-rebar-auth0", "package_url": "https://pypi.org/project/flask-rebar-auth0/", "platform": "", "project_url": "https://pypi.org/project/flask-rebar-auth0/", "project_urls": { "Homepage": "https://github.com/Sytten/flask-rebar-auth0" }, "release_url": "https://pypi.org/project/flask-rebar-auth0/0.1.7/", "requires_dist": [ "flask-rebar (<2,>=1.0.0)", "Flask (<2,>=0.10)", "requests (<3,>=2.20.0)", "python-jose (<4,>=3.0.1)", "cryptography (<3,>=2.6.1)", "pytest ; extra == 'dev'", "pytest-cov ; extra == 'dev'", "pytest-mock ; extra == 'dev'", "requests-mock ; extra == 'dev'", "black ; extra == 'dev'", "codecov ; extra == 'dev'" ], "requires_python": "", "summary": "Flask-Rebar-Auth0 is a simple Flask-Rebar authenticator Auth0", "version": "0.1.7" }, "last_serial": 5867059, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "5c8f0752526fcceb9ed529bf3c6e119e", "sha256": "8126f63c35eae8b773bb5fd9a260ccece63f44cd95609679070052468eaebb01" }, "downloads": -1, "filename": "flask_rebar_auth0-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "5c8f0752526fcceb9ed529bf3c6e119e", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 1555, "upload_time": "2019-03-29T08:10:33", "url": "https://files.pythonhosted.org/packages/cf/52/2e93f322f30c0dbc07c3d0cb0662facbf157e0e3b4d7647d78cd0c67456d/flask_rebar_auth0-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "948c2f45bf3dfd889d17c42d84d3a92c", "sha256": "24b0338ea8e2966f517353e914fd991d9814c5cf20e59bebc038ce842ba1a143" }, "downloads": -1, "filename": "flask-rebar-auth0-0.1.0.tar.gz", "has_sig": false, "md5_digest": "948c2f45bf3dfd889d17c42d84d3a92c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1482, "upload_time": "2019-03-29T08:10:35", "url": "https://files.pythonhosted.org/packages/23/d2/f00150c95c6c4acba46f90db38594dcf20d9c6595211e2a9a69a67c0316b/flask-rebar-auth0-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "5fea4c151f3cc4085912aa0f9bd01fb1", "sha256": "0d8c583a59e1f06304aba4a15f872e27d66b6e92fdd40b96fa85bd705eb198ae" }, "downloads": -1, "filename": "flask_rebar_auth0-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "5fea4c151f3cc4085912aa0f9bd01fb1", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 2322, "upload_time": "2019-03-29T08:41:10", "url": "https://files.pythonhosted.org/packages/4b/4d/80dbf7e580d3cfc293d132b6020eb230a283a8dcde5eacf09ca22808e85f/flask_rebar_auth0-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "cd076c9dcbc1d477eb56680388092e94", "sha256": "af02cf21dadeb4edb065d0a4a7881bd9d2f731bd85b1b791288b1532b6ff9a63" }, "downloads": -1, "filename": "flask-rebar-auth0-0.1.1.tar.gz", "has_sig": false, "md5_digest": "cd076c9dcbc1d477eb56680388092e94", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2414, "upload_time": "2019-03-29T08:41:12", "url": "https://files.pythonhosted.org/packages/73/44/6cece1cc324b710684f0c78d8b4fa410ed3c3821891c4b85f06e3939d148/flask-rebar-auth0-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "f236b583d485ae89c84b263ce28e33f9", "sha256": "d8cf6444d5ffedd2e6329f22ec16c0d09c0f02fbfc6c04038bd8cac3861c3783" }, "downloads": -1, "filename": "flask_rebar_auth0-0.1.2-py3-none-any.whl", "has_sig": false, "md5_digest": "f236b583d485ae89c84b263ce28e33f9", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 3148, "upload_time": "2019-03-29T15:59:45", "url": "https://files.pythonhosted.org/packages/47/ba/9fca8ca8f99d707d0910a133e5e8ed91f9320837c6bcc6b9e118165b294d/flask_rebar_auth0-0.1.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "cb53721d2e6e36243603148589838981", "sha256": "ab90cea338566d43f7f07d7a8abfd41abce0e6b937627c0367491dec16d00735" }, "downloads": -1, "filename": "flask-rebar-auth0-0.1.2.tar.gz", "has_sig": false, "md5_digest": "cb53721d2e6e36243603148589838981", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2407, "upload_time": "2019-03-29T15:59:46", "url": "https://files.pythonhosted.org/packages/e6/7c/8a29bdaf8360a9d3037e02d09c0adf52a08f8660d086c93415f0996e570f/flask-rebar-auth0-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "216b524a4b5bcec9c3b23d989b867f65", "sha256": "f821435679ca2415ef9a59b8231ca023191727c14b550c016824fc45a1d44a2d" }, "downloads": -1, "filename": "flask_rebar_auth0-0.1.3-py3-none-any.whl", "has_sig": false, "md5_digest": "216b524a4b5bcec9c3b23d989b867f65", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5282, "upload_time": "2019-03-29T17:08:14", "url": "https://files.pythonhosted.org/packages/49/5d/2bda53bfcb521d0e8dd5023a2a0b74be10a0a35054dd9e2ea49fa9814d40/flask_rebar_auth0-0.1.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "df149e8f4080a7678f34945f5ebd50b4", "sha256": "5d3763b42dd85fa10197300b137cde1ae9bd61f9b135dad080d638db2e037f51" }, "downloads": -1, "filename": "flask-rebar-auth0-0.1.3.tar.gz", "has_sig": false, "md5_digest": "df149e8f4080a7678f34945f5ebd50b4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4223, "upload_time": "2019-03-29T17:08:15", "url": "https://files.pythonhosted.org/packages/28/e5/b1a3b4ebf802058e9ff5f70197a9d9eea8fb07cdc88500f631f1d23602e3/flask-rebar-auth0-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "b9e318a288ddebd380b358e4b8646b82", "sha256": "18c7f709c5e9be6e5d1297ae0ca0c90b89f6ddc38d085c3a2f0dc6399cc0e514" }, "downloads": -1, "filename": "flask_rebar_auth0-0.1.4-py3-none-any.whl", "has_sig": false, "md5_digest": "b9e318a288ddebd380b358e4b8646b82", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6561, "upload_time": "2019-03-30T04:22:14", "url": "https://files.pythonhosted.org/packages/3e/33/adfe2f3c315357fb3199a94f5ee1e79c1484e5a16b72b5b9e054f9517dd2/flask_rebar_auth0-0.1.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8aee661353e3e2799f84bd003396d3c7", "sha256": "b1615acc20462fba96fdf02c53251e45050213a07c0175c582f6879329c39ac0" }, "downloads": -1, "filename": "flask-rebar-auth0-0.1.4.tar.gz", "has_sig": false, "md5_digest": "8aee661353e3e2799f84bd003396d3c7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4836, "upload_time": "2019-03-30T04:22:15", "url": "https://files.pythonhosted.org/packages/8a/ad/3fe4f610b2952957db0dcbd35566610a9169270e9e916d0a303c17ded4d5/flask-rebar-auth0-0.1.4.tar.gz" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "fa878f7b7c3aecef517813a3f35ac493", "sha256": "eed32ac26a26e35e47544b83a5b5bc1d05c879fcebdd19645b476d83d4bb1685" }, "downloads": -1, "filename": "flask_rebar_auth0-0.1.5-py3-none-any.whl", "has_sig": false, "md5_digest": "fa878f7b7c3aecef517813a3f35ac493", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6739, "upload_time": "2019-04-16T16:49:48", "url": "https://files.pythonhosted.org/packages/74/b5/4ca4a9aeedc1a660bc18e281d7c1cea06974ff9d3c568223077e57a05bce/flask_rebar_auth0-0.1.5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "bbdb4b2c25a9b4f7da3412b48efe520d", "sha256": "03b5c000455b213cf97a698a8d60d1a4ab31fba37d7fcdd99992d575d9c584d8" }, "downloads": -1, "filename": "flask-rebar-auth0-0.1.5.tar.gz", "has_sig": false, "md5_digest": "bbdb4b2c25a9b4f7da3412b48efe520d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5023, "upload_time": "2019-04-16T16:49:50", "url": "https://files.pythonhosted.org/packages/67/df/2e8b9cc18e3e243f3a7cafd415941c99d332a56b27f5682aeea935bce3e4/flask-rebar-auth0-0.1.5.tar.gz" } ], "0.1.6": [ { "comment_text": "", "digests": { "md5": "61519ff492582edbf0b56cdf5da26e82", "sha256": "2bf20b2ddc764cf643b4cdb09d74cfc00b4a4f59eb964e0074f4ac6057147236" }, "downloads": -1, "filename": "flask_rebar_auth0-0.1.6-py3-none-any.whl", "has_sig": false, "md5_digest": "61519ff492582edbf0b56cdf5da26e82", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8204, "upload_time": "2019-09-20T22:04:38", "url": "https://files.pythonhosted.org/packages/9c/f7/ba5f9abb493abacf16ffeacab989e0d14898afeb5c306666b5c314b71319/flask_rebar_auth0-0.1.6-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "bfc83784216ff47adcfab3002e4cb84b", "sha256": "b3b876a2058a0b65b623f491535adb22a3cb977ad3aae60b6923b993eb3e80d2" }, "downloads": -1, "filename": "flask-rebar-auth0-0.1.6.tar.gz", "has_sig": false, "md5_digest": "bfc83784216ff47adcfab3002e4cb84b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6720, "upload_time": "2019-09-20T22:04:40", "url": "https://files.pythonhosted.org/packages/01/b2/4abee469d562b49569a5ad767d27953055e6d80ef47f2b543dc666bec5c3/flask-rebar-auth0-0.1.6.tar.gz" } ], "0.1.7": [ { "comment_text": "", "digests": { "md5": "6651a9dda5833bb78382937443b6d096", "sha256": "c514072ea3e3fbb703d79abba7115ee841182e8ba6a77cc001457d12c54cec15" }, "downloads": -1, "filename": "flask_rebar_auth0-0.1.7-py3-none-any.whl", "has_sig": false, "md5_digest": "6651a9dda5833bb78382937443b6d096", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8543, "upload_time": "2019-09-21T20:13:17", "url": "https://files.pythonhosted.org/packages/62/0e/fe9ebb92e96aa556ceb5c0faae824ff15c4a67e64849f5eb254fc2077427/flask_rebar_auth0-0.1.7-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "556466a6b77b98a457b5740d93be6b0a", "sha256": "133f7e601831e536c171a70fa8940b571d5217bcfd3f49164ac332a11e3619b5" }, "downloads": -1, "filename": "flask-rebar-auth0-0.1.7.tar.gz", "has_sig": false, "md5_digest": "556466a6b77b98a457b5740d93be6b0a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7002, "upload_time": "2019-09-21T20:13:19", "url": "https://files.pythonhosted.org/packages/29/86/f66042fa807cab889a8ca33fe9009bde8403de8cc18272fbc76ed4fa892b/flask-rebar-auth0-0.1.7.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "6651a9dda5833bb78382937443b6d096", "sha256": "c514072ea3e3fbb703d79abba7115ee841182e8ba6a77cc001457d12c54cec15" }, "downloads": -1, "filename": "flask_rebar_auth0-0.1.7-py3-none-any.whl", "has_sig": false, "md5_digest": "6651a9dda5833bb78382937443b6d096", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8543, "upload_time": "2019-09-21T20:13:17", "url": "https://files.pythonhosted.org/packages/62/0e/fe9ebb92e96aa556ceb5c0faae824ff15c4a67e64849f5eb254fc2077427/flask_rebar_auth0-0.1.7-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "556466a6b77b98a457b5740d93be6b0a", "sha256": "133f7e601831e536c171a70fa8940b571d5217bcfd3f49164ac332a11e3619b5" }, "downloads": -1, "filename": "flask-rebar-auth0-0.1.7.tar.gz", "has_sig": false, "md5_digest": "556466a6b77b98a457b5740d93be6b0a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7002, "upload_time": "2019-09-21T20:13:19", "url": "https://files.pythonhosted.org/packages/29/86/f66042fa807cab889a8ca33fe9009bde8403de8cc18272fbc76ed4fa892b/flask-rebar-auth0-0.1.7.tar.gz" } ] }