{ "info": { "author": "Benjamin Einaudi", "author_email": "antechrestos@gmail.com", "bugtrack_url": null, "classifiers": [ "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Topic :: Communications" ], "description": "OAuth2Client\n============\n.. image:: https://img.shields.io/pypi/v/oauth2-client.svg\n :target: https://pypi.python.org/pypi/oauth2-client\n\n.. image:: https://img.shields.io/github/license/antechrestos/Oauth2Client.svg\n :target: https://raw.githubusercontent.com/antechrestos/OAuth2Client/master/LICENSE\n\n\nPresentation\n------------\nOAuth2Client is a simple python client library for OAuth2. It is based on the requests_\n .. _requests: https://pypi.python.org/pypi/requests/\n\nIt is now supported for python 2 and 3\n\nLogin process\n-------------\nFor now it can handle two token process:\n\n* Authorization code\n* User Credentials\n* Client Credentials\n\nAuthorization code\n~~~~~~~~~~~~~~~~~~\nSince authorization code process needs the user to accept the access to its data by the application, the library\nstarts locally a http server. You may put the host part of the ``redirect_uri`` parameter in your *hosts* file\npointing to your loop-back address. The server waits a ``GET`` requests with the ``code`` as a query parameter.\n\nGetting a couple of access token may be done like this:\n\n.. code-block:: python\n\n scopes = ['scope_1', 'scope_2']\n\n service_information = ServiceInformation('https://authorization-server/oauth/authorize',\n 'https://token-server/oauth/token',\n 'client_id',\n 'client_secret',\n scopes)\n manager = CredentialManager(service_information,\n proxies=dict(http='http://localhost:3128', https='http://localhost:3128'))\n redirect_uri = 'http://somewhere.io:8080/oauth/code'\n\n # Builds the authorization url and starts the local server according to the redirect_uri parameter\n url = manager.init_authorize_code_process(redirect_uri, 'state_test')\n _logger.info('Open this url in your browser\\n%s', url)\n\n code = manager.wait_and_terminate_authorize_code_process()\n # From this point the http server is opened on 8080 port and wait to receive a single GET request\n # All you need to do is open the url and the process will go on\n # (as long you put the host part of your redirect uri in your host file)\n # when the server gets the request with the code (or error) in its query parameters\n _logger.debug('Code got = %s', code)\n manager.init_with_authorize_code(redirect_uri, code)\n _logger.debug('Access got = %s', manager._access_token)\n # Here access and refresh token may be used with self.refresh_token\n\nUser credentials\n~~~~~~~~~~~~~~~~\nGetting a couple of access and refresh token is much easier:\n\n.. code-block:: python\n\n scopes = ['scope_1', 'scope_2']\n\n service_information = ServiceInformation('https://authorization-server/oauth/authorize',\n 'https://token-server/oauth/token',\n 'client_id',\n 'client_secret',\n scopes)\n manager = CredentialManager(service_information,\n proxies=dict(http='http://localhost:3128', https='http://localhost:3128'))\n manager.init_with_user_credentials('login', 'password')\n _logger.debug('Access got = %s', manager._access_token)\n # Here access and refresh token may be used\n\nClient credentials\n~~~~~~~~~~~~~~~~~~\nYou can also get a token with client credentials process\n\n.. code-block:: python\n\n manager = CredentialManager(service_information,\n proxies=dict(http='http://localhost:3128', https='http://localhost:3128'))\n manager.init_with_client_credentials()\n # here application admin operation may be called\n\nRefresh token\n~~~~~~~~~~~~~\nProvided that you kept a previous ``refresh_token``, you can initiate your credential manager with it:\n\n.. code-block:: python\n\n manager = CredentialManager(service_information,\n proxies=dict(http='http://localhost:3128', https='http://localhost:3128'))\n manager.init_with_token('my saved refreshed token')\n\nToken expiration\n~~~~~~~~~~~~~~~~\n``CredentialManager`` class handle token expiration by calling the ``CredentialManager._is_token_expired`` static method.\nThis implementation is not accurate for all OAuth server implementation. You'd better extend ``CredentialManager`` class\nand override ``_is_token_expired`` method.\n\nRead other fields from token response\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n``CredentialManager`` can be subclassed to handle other token response fields such as ``id_token`` in OpenId protocol.\n\n.. code-block:: python\n\n class OpenIdCredentialManager(CredentialManager):\n def __init__(self, service_information, proxies=None):\n super(OpenIdCredentialManager, self).__init__(service_information, proxies)\n self.id_token = None\n\n def _process_token_response(self, token_response, refresh_token_mandatory):\n id_token = token_response.get('id_token')\n OpenIdCredentialManager._check_id(id_token)\n super(OpenIdCredentialManager, self)._process_token_response(token_response, refresh_token_mandatory)\n self.id_token = id_token\n\n @staticmethod\n def _check_id(id_token):\n # check that open id token is valid\n pass\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/antechrestos/OAuth2Client", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "oauth2-client", "package_url": "https://pypi.org/project/oauth2-client/", "platform": "", "project_url": "https://pypi.org/project/oauth2-client/", "project_urls": { "Homepage": "http://github.com/antechrestos/OAuth2Client" }, "release_url": "https://pypi.org/project/oauth2-client/1.1.0/", "requires_dist": null, "requires_python": "", "summary": "A client library for OAuth2", "version": "1.1.0" }, "last_serial": 4501738, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "53bc050122a5b703066a917940155fe8", "sha256": "1950e90e8eda76b3bef1e85cd57cfc53ca2eb4c81445f5da7adaa495b61afdd6" }, "downloads": -1, "filename": "oauth2-client-0.0.1.zip", "has_sig": false, "md5_digest": "53bc050122a5b703066a917940155fe8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8175, "upload_time": "2016-04-22T08:11:09", "url": "https://files.pythonhosted.org/packages/c8/aa/0620d2238abe8476dcf0ddeb84f629fd8c49c4d7fb81b27d4ca08cdb5b50/oauth2-client-0.0.1.zip" } ], "0.0.10": [ { "comment_text": "", "digests": { "md5": "4d47eb8c902648a9c315992d801434dd", "sha256": "e8d16d75ce170dafa435d322a35d57da4833f8e5f919c84a2e7c6cde8bad7805" }, "downloads": -1, "filename": "oauth2-client-0.0.10.tar.gz", "has_sig": false, "md5_digest": "4d47eb8c902648a9c315992d801434dd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5585, "upload_time": "2016-07-16T16:20:23", "url": "https://files.pythonhosted.org/packages/47/98/5dba868467d2bbafbb49100a7451a11dde0f4b48b46f443e8a128977ecde/oauth2-client-0.0.10.tar.gz" } ], "0.0.11": [ { "comment_text": "", "digests": { "md5": "277f40e6fc3b62ccd220ceeb1c19f45d", "sha256": "4cdba98822ce24d830def00190defa5373def03bcb9197fbe1246edb5e636c78" }, "downloads": -1, "filename": "oauth2-client-0.0.11.tar.gz", "has_sig": false, "md5_digest": "277f40e6fc3b62ccd220ceeb1c19f45d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5589, "upload_time": "2016-07-17T14:40:43", "url": "https://files.pythonhosted.org/packages/f6/e5/a3b93ef155695f18cb34017415d8493a51a6feedac297cfbfc72200ce8f9/oauth2-client-0.0.11.tar.gz" } ], "0.0.12": [ { "comment_text": "", "digests": { "md5": "896edb87c55498746a09f04bc511c0ee", "sha256": "7650724da53d5f9d216b2d9013e1205b1a06996b88346af962ba75a61cdd4548" }, "downloads": -1, "filename": "oauth2-client-0.0.12.zip", "has_sig": false, "md5_digest": "896edb87c55498746a09f04bc511c0ee", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9993, "upload_time": "2016-07-23T15:15:38", "url": "https://files.pythonhosted.org/packages/27/77/74c1e5446b8262813a1de6f347b570003cbcb8da2f21671fde4b3aeef50a/oauth2-client-0.0.12.zip" } ], "0.0.13": [ { "comment_text": "", "digests": { "md5": "2160fa4aab79b47b0fa8ab8ff67f5ee2", "sha256": "28ab00a6cdca91a39e792d3f6b07e7447e6cefb2892653dbdad93cb5559e0721" }, "downloads": -1, "filename": "oauth2-client-0.0.13.tar.gz", "has_sig": false, "md5_digest": "2160fa4aab79b47b0fa8ab8ff67f5ee2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6367, "upload_time": "2016-11-06T11:30:10", "url": "https://files.pythonhosted.org/packages/55/e5/8fd6bae5448a45e72f7a89a2f4690ca8ca003649a169228371fbf8b00df9/oauth2-client-0.0.13.tar.gz" } ], "0.0.14": [ { "comment_text": "", "digests": { "md5": "785e69497c434be5b332f2e3234d4790", "sha256": "af03e34e1f13dc995de57003fdc1a0e2c48444cc9d163b5df98e4476cea9d559" }, "downloads": -1, "filename": "oauth2-client-0.0.14.zip", "has_sig": false, "md5_digest": "785e69497c434be5b332f2e3234d4790", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11952, "upload_time": "2016-11-07T15:07:28", "url": "https://files.pythonhosted.org/packages/4e/e5/08dbfa847ba0fd132025fafd049de9c2528acfc4be683703c4dd2bf9ff5d/oauth2-client-0.0.14.zip" } ], "0.0.15": [ { "comment_text": "", "digests": { "md5": "7885ebf5ef400efeb3e5488a1836330f", "sha256": "ed121ed8d14c2b4b96801c0f4bafc1e25ab24225a59fd7df614b957ab06c2c98" }, "downloads": -1, "filename": "oauth2-client-0.0.15.zip", "has_sig": false, "md5_digest": "7885ebf5ef400efeb3e5488a1836330f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11953, "upload_time": "2016-11-07T15:11:03", "url": "https://files.pythonhosted.org/packages/48/99/10749c17a06b0e032ac11bc709c0c31ec418b1ece7ca4101c0d46b5a3e4c/oauth2-client-0.0.15.zip" } ], "0.0.16": [ { "comment_text": "", "digests": { "md5": "78cfe5f01fcec70e41ab19aa499f8cd7", "sha256": "b123e9a55f1d20605e5c98ee4c7c864358eb1c060aba1710a979e852e3181aa6" }, "downloads": -1, "filename": "oauth2-client-0.0.16.tar.gz", "has_sig": false, "md5_digest": "78cfe5f01fcec70e41ab19aa499f8cd7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6335, "upload_time": "2017-01-16T13:19:08", "url": "https://files.pythonhosted.org/packages/6e/30/326613e9cd0f9b225bb2ed0dddf4d8ecc6e9605ee42465e1dfea75e3e3ea/oauth2-client-0.0.16.tar.gz" } ], "0.0.17": [ { "comment_text": "", "digests": { "md5": "4e508155a87b66439cfc0d35b77e29f8", "sha256": "986db13f783d903f0823fced5d044b498128edbe87b357423445a9f984b60f12" }, "downloads": -1, "filename": "oauth2-client-0.0.17.tar.gz", "has_sig": false, "md5_digest": "4e508155a87b66439cfc0d35b77e29f8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6420, "upload_time": "2017-01-26T10:38:05", "url": "https://files.pythonhosted.org/packages/66/0d/cee8f3bddac9064a955baf54236461e91f38628f0042f9d728c8825e5ce6/oauth2-client-0.0.17.tar.gz" } ], "0.0.18": [ { "comment_text": "", "digests": { "md5": "c3d29d3df5f90bd5d74ff7d4438e51de", "sha256": "0ae5055bb0b8e761785af04143824d11382a51a0b8e3b57e3fdc92c0b3d816e2" }, "downloads": -1, "filename": "oauth2-client-0.0.18.tar.gz", "has_sig": false, "md5_digest": "c3d29d3df5f90bd5d74ff7d4438e51de", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6427, "upload_time": "2017-03-09T13:44:42", "url": "https://files.pythonhosted.org/packages/4d/fc/809e60d0d6d6d3370414fccba446522151ec3494b9eddb00ada56723ed9b/oauth2-client-0.0.18.tar.gz" } ], "0.0.19": [ { "comment_text": "", "digests": { "md5": "59ad5d3c18e14afafea9475524af0f80", "sha256": "a7f76966d5675ed27c6e46528b38b7fe13d205ceca64f4ca6a4e44426513015f" }, "downloads": -1, "filename": "oauth2-client-0.0.19.tar.gz", "has_sig": false, "md5_digest": "59ad5d3c18e14afafea9475524af0f80", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6477, "upload_time": "2017-09-02T10:55:05", "url": "https://files.pythonhosted.org/packages/3f/6e/e2bccd55c3bc6bb10b15aca55b5f6a4e8cc5c4f50f62a57749e4df3a63d4/oauth2-client-0.0.19.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "42758be980f9fc4f31c5fd9e28fbbad0", "sha256": "d323a7421ec7271106ba57fcf273bb539cc9c56905746b048f0f6917bbe36001" }, "downloads": -1, "filename": "oauth2-client-0.0.2.zip", "has_sig": false, "md5_digest": "42758be980f9fc4f31c5fd9e28fbbad0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9610, "upload_time": "2016-04-22T08:27:02", "url": "https://files.pythonhosted.org/packages/c8/b0/e7d106f3e5f49bd353edcb4e09dba00902af3332b151eae48dbdceb9fb42/oauth2-client-0.0.2.zip" } ], "0.0.20": [ { "comment_text": "", "digests": { "md5": "fcbfd4b9c5a5d35c68c88e0efe9e211e", "sha256": "e1f4c57e03730f8f8b793edfa7eab5babf11b35f362457ce41fba10e244eba62" }, "downloads": -1, "filename": "oauth2-client-0.0.20.tar.gz", "has_sig": false, "md5_digest": "fcbfd4b9c5a5d35c68c88e0efe9e211e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6801, "upload_time": "2017-09-22T12:18:14", "url": "https://files.pythonhosted.org/packages/58/47/72083ed62883fdd58a0c30bb64aefd8d72df5052d9d467b023e517db605c/oauth2-client-0.0.20.tar.gz" } ], "0.0.21": [ { "comment_text": "", "digests": { "md5": "999710a288a0f700894ddeaafdb25fe2", "sha256": "a2ff66bb930a2e4f90ba9625d1d4c98d2ca20a2b2c1f8b1ed532b69dba57fa67" }, "downloads": -1, "filename": "oauth2-client-0.0.21.tar.gz", "has_sig": false, "md5_digest": "999710a288a0f700894ddeaafdb25fe2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6841, "upload_time": "2017-11-09T14:01:28", "url": "https://files.pythonhosted.org/packages/82/2c/27a8a5e4657340c75d18de9d442759a7f79f8f4ca575cc9b6a0d10b56775/oauth2-client-0.0.21.tar.gz" } ], "0.0.22": [ { "comment_text": "", "digests": { "md5": "ba22fcff14d721a918c169f772dde67b", "sha256": "a3ea5c23c6e4ca8976de3c5a9bfee78ce4a22bd55c230b3b3f37e55a8133f7f0" }, "downloads": -1, "filename": "oauth2-client-0.0.22.tar.gz", "has_sig": false, "md5_digest": "ba22fcff14d721a918c169f772dde67b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6885, "upload_time": "2018-03-13T07:36:49", "url": "https://files.pythonhosted.org/packages/dc/f0/11211e6c304774a7efad548f6b89690f8b731b44a36c75a1810fbed264ef/oauth2-client-0.0.22.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "5f58c5ba4f5d39bbdb9d8b0883f60ef6", "sha256": "46402a51bf8146a4acaa3868cd56202eceaabea1ce3bf1066e2121f42c63ad86" }, "downloads": -1, "filename": "oauth2-client-0.0.3.zip", "has_sig": false, "md5_digest": "5f58c5ba4f5d39bbdb9d8b0883f60ef6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9785, "upload_time": "2016-04-22T12:22:16", "url": "https://files.pythonhosted.org/packages/76/5e/70691f6ab2858efc1f6fa4fe56c18b5728636f3df5ac70971c2338afddb1/oauth2-client-0.0.3.zip" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "3177c29842892d7d887dbc36d49d1220", "sha256": "78c238cc0555e3f6afcc4a87db1a8beecf585661c7e06df5ea3c3718f43793bd" }, "downloads": -1, "filename": "oauth2-client-0.0.4.zip", "has_sig": false, "md5_digest": "3177c29842892d7d887dbc36d49d1220", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9825, "upload_time": "2016-04-23T10:39:54", "url": "https://files.pythonhosted.org/packages/d3/5f/73cb69e4bcf4ee99a0bc325f53290cefb60ddab1c5f7d73bdb1c754eca60/oauth2-client-0.0.4.zip" } ], "0.0.5": [ { "comment_text": "", "digests": { "md5": "540059fb205b698a95150f03f968ceff", "sha256": "7deb6dd814b53bff7a282dcce21ca536f509a113ede1bda400696c1dd95d69cd" }, "downloads": -1, "filename": "oauth2-client-0.0.5.zip", "has_sig": false, "md5_digest": "540059fb205b698a95150f03f968ceff", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9867, "upload_time": "2016-04-27T09:52:12", "url": "https://files.pythonhosted.org/packages/19/6e/709b83c6300fda392002da922a42a9f8c53c0ce623929349d94ec275e10e/oauth2-client-0.0.5.zip" } ], "0.0.6": [ { "comment_text": "", "digests": { "md5": "f6088edc077d3460d83a93162ed41f2b", "sha256": "c88cd37563149274b238f9c3d6a258f34960637a90b4bee2832508acb4b17791" }, "downloads": -1, "filename": "oauth2-client-0.0.6.tar.gz", "has_sig": false, "md5_digest": "f6088edc077d3460d83a93162ed41f2b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5500, "upload_time": "2016-07-09T19:26:37", "url": "https://files.pythonhosted.org/packages/82/12/c5f81c8d7adf05c1cb8dfc404dd9208eccdc68400ce2f99aef1ed3b665a1/oauth2-client-0.0.6.tar.gz" } ], "0.0.7": [ { "comment_text": "", "digests": { "md5": "f1d9f7a930db2b213b0691fa49c95b93", "sha256": "736806d1730c37e1907a5100f51c2919a7657af0f9f8f5946a0ba4cb659efdd8" }, "downloads": -1, "filename": "oauth2-client-0.0.7.zip", "has_sig": false, "md5_digest": "f1d9f7a930db2b213b0691fa49c95b93", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9940, "upload_time": "2016-07-12T17:18:38", "url": "https://files.pythonhosted.org/packages/be/a5/50f3412dd95f57de8344d2060f8a5469fdb2406db5a15908509f0b58c482/oauth2-client-0.0.7.zip" } ], "0.0.8": [ { "comment_text": "", "digests": { "md5": "84e90ff2dea94460dc3496beaf352cd1", "sha256": "d893306868382e4616556f4877c81c3bdd91274aec5e549adb1f5f3a6a460c86" }, "downloads": -1, "filename": "oauth2-client-0.0.8.tar.gz", "has_sig": false, "md5_digest": "84e90ff2dea94460dc3496beaf352cd1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5582, "upload_time": "2016-07-16T16:06:23", "url": "https://files.pythonhosted.org/packages/11/1b/1b973b90cf1c6c5942bd0ff04537071cc0413ea25a222049f8f1d1c87e9f/oauth2-client-0.0.8.tar.gz" } ], "0.0.9": [ { "comment_text": "", "digests": { "md5": "46f3ecfccff2f3511ea1eeb7e3ab6c87", "sha256": "ceca135aaeefb1258294763548553dd5a4adac3b01c36707db2264949d07bed0" }, "downloads": -1, "filename": "oauth2-client-0.0.9.tar.gz", "has_sig": false, "md5_digest": "46f3ecfccff2f3511ea1eeb7e3ab6c87", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5584, "upload_time": "2016-07-16T16:10:24", "url": "https://files.pythonhosted.org/packages/7f/a3/8bfe8a9af116472bf3075dc4a1927ce0de0312aa6a970ad1da6d326ca25f/oauth2-client-0.0.9.tar.gz" } ], "1.0.0": [ { "comment_text": "", "digests": { "md5": "955ecb9487774f7b624b397a4ac038d3", "sha256": "d119a620b6630f2456d98e04bc6b3a7134253551656948f6a01b59324ac8ee28" }, "downloads": -1, "filename": "oauth2-client-1.0.0.tar.gz", "has_sig": false, "md5_digest": "955ecb9487774f7b624b397a4ac038d3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6866, "upload_time": "2018-11-11T19:23:01", "url": "https://files.pythonhosted.org/packages/30/50/553852726828d337ae2a4519488dfb6e4a636c421f044a0032d44560fd13/oauth2-client-1.0.0.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "8530963b528c88a0a81cec35c774d989", "sha256": "1ffff05b60f545c41f4ccbd4efd232dd2f72ed242ccc8bb64847d4ccdcb7745e" }, "downloads": -1, "filename": "oauth2-client-1.1.0.tar.gz", "has_sig": false, "md5_digest": "8530963b528c88a0a81cec35c774d989", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6922, "upload_time": "2018-11-19T07:30:54", "url": "https://files.pythonhosted.org/packages/82/3a/6eb226d4be8f772654051d9b062e2a74f7fdf2aa453f929e61992ad3c761/oauth2-client-1.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "8530963b528c88a0a81cec35c774d989", "sha256": "1ffff05b60f545c41f4ccbd4efd232dd2f72ed242ccc8bb64847d4ccdcb7745e" }, "downloads": -1, "filename": "oauth2-client-1.1.0.tar.gz", "has_sig": false, "md5_digest": "8530963b528c88a0a81cec35c774d989", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6922, "upload_time": "2018-11-19T07:30:54", "url": "https://files.pythonhosted.org/packages/82/3a/6eb226d4be8f772654051d9b062e2a74f7fdf2aa453f929e61992ad3c761/oauth2-client-1.1.0.tar.gz" } ] }