{ "info": { "author": "Micha\u0142 Jaworski", "author_email": "swistakm@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3" ], "description": "[![Build Status](https://travis-ci.org/swistakm/talons-oauth.svg?branch=master)](https://travis-ci.org/swistakm/talons-oauth)\n\n# Talons OAuth authentication extension\n\n`talons-oauth` provides OAuth 1.0 extension for\n[Talons WSGI middleware library](https://github.com/talons/talons)\nin `talons.auth` namespace. You can install it with pip:\n\n```\npip install talons-oauth\n```\n\n\n## Usage example\n\nUse `talons-oauth` the same way you would use any other talons auth middleware\n\n```python\nimport falcon\nfrom falcon.auth.oauth import oauth1\n\n# Assume getappconfig() returns a dictionary of application configuration\n# options that may have been read from some INI file...\nconfig = getappconfig()\n\nauth_middleware = middleware.create_middleware(identify_with=[oauth1.Identifier],\n authenticate_with=[oauth1.Authenticator],\n **config)\napp = falcon.API()\n```\n\n## `talons.auth.oauth.oauth1.Identifier`\n\nOAuth authentication flow is a bit more sophisticated than `talons.auth`\nmiddlewares assumes about typical authentication. There is no clear boundary\nbetween identification and authentication in most of OAuth implementations.\nThere is no user credentials *per se* but credentials of oauth consumer\nthat authenticates on behalf of user. Because of that `oauth1.Identifier`\nidentificates \"user\" by whole set of request body, method, headers and url\nparameters. This data will be needed then for verifing request signature.\n\n`oauth1.Identifier.identify()` returns `True` only if request looks like\nOAuth 1.0. request - has either valid auth header, body parameters or query\nstring (as specified in [RFC 5849](http://tools.ietf.org/html/rfc5849)).\nIdentity stored in request is a `talons.auth.oauth.oauth1.OAuthIdentity`\ninstance that subclasses `talons.auth.interfaces.Identity`. All its base\nattributes (`login`, `key`, `roles`, `groups`) are set to `None' or default\nvalue. This should not break other talons authenticators.\n\n## `talons.auth.oauth.oauth1.Authenticator`\n\n`oauth1.Authenticator` won't work OOTB. It uses\n[oauthlib](https://github.com/idan/oauthlib) as oauth provider backend which as\nwell as falcon and talons do tries to be non opinionated. This means that it\ndoesn't assume anything about your your type of storage or data architecture.\nYou must provide an\n`oauthlib.oauth1.rfc5849.request_validator.RequestValidator`\nsubclass instance that tells library how to validate/save/verify/retrieve your\ntokens, nonces, keys, etc. Fortunately this procedure is very simple and well\ndocumented in [oauthlib's documentation](https://oauthlib.readthedocs.org/en/latest/oauth1/server.html).\n\nOther thing you would like probably to configure is a list of available\nauthentication realms that are required by your API instance. It can be set as\na list of required realms for whole api instance. Unfortunately\nfalcon hooks are not aware of resource affected by request and realms cannot\nbe set per resource individually. If you would like to have diffrent\nauthentication realms for many resources I would advice you splitting your API\ninto many instances based on their realms.\n\nFull list of configuration parameters:\n\n* `oauth1_validator`: `oauthlib.oauth1.rfc5849.request_validator.RequestValidator`\n (required). Defines how to validate/save/verify/retrieve your OAuth 1.0. tokens,\n nonces, keys, etc. For full documentation refer to\n [oauthlib's RequestValidator](https://oauthlib.readthedocs.org/en/latest/oauth1/validator.html)\n documentation.\n* `oauth1_realms`: list (defaults to []). list of required realms for consumer\n access tokens.\n\n## Providing OAuth 1.0. endpoints\n\nProviding endpoints for accessing/authorizing request tokens and access tokens\nis beyond the scope of this library. Once you create your `RequestValidator`\nsubclass it should be easy to use\n[generic oauthlib endpoints](https://oauthlib.readthedocs.org/en/latest/oauth1/server.html#create-your-endpoint-views).", "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/swistakm/talons-oauth", "keywords": null, "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "talons.auth.oauth", "package_url": "https://pypi.org/project/talons.auth.oauth/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/talons.auth.oauth/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/swistakm/talons-oauth" }, "release_url": "https://pypi.org/project/talons.auth.oauth/0.0.1/", "requires_dist": null, "requires_python": null, "summary": "OAuth 1.0 extension for Talons WSGI middleware library", "version": "0.0.1" }, "last_serial": 1100969, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "61e099675b65389c50b832119af05bef", "sha256": "4de16afefbd104b62fe124bb40fd7880cdd3b31501d54822083a9fa8e49ad46d" }, "downloads": -1, "filename": "talons.auth.oauth-0.0.1.tar.gz", "has_sig": false, "md5_digest": "61e099675b65389c50b832119af05bef", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8342, "upload_time": "2014-05-22T12:50:39", "url": "https://files.pythonhosted.org/packages/bf/e2/16dd17b816c10a16ad09818afa2641202b23cfe161fc492c1ed1b971bfcf/talons.auth.oauth-0.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "61e099675b65389c50b832119af05bef", "sha256": "4de16afefbd104b62fe124bb40fd7880cdd3b31501d54822083a9fa8e49ad46d" }, "downloads": -1, "filename": "talons.auth.oauth-0.0.1.tar.gz", "has_sig": false, "md5_digest": "61e099675b65389c50b832119af05bef", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8342, "upload_time": "2014-05-22T12:50:39", "url": "https://files.pythonhosted.org/packages/bf/e2/16dd17b816c10a16ad09818afa2641202b23cfe161fc492c1ed1b971bfcf/talons.auth.oauth-0.0.1.tar.gz" } ] }