{ "info": { "author": "Authlete, Inc.", "author_email": "admin@authlete.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: Apache Software License", "Operating System :: OS Independent", "Programming Language :: Python :: 3", "Topic :: Security" ], "description": "Authlete Library for Python\n===========================\n\nOverview\n--------\n\nThis is the official Python library for [Authlete](https://www.authlete.com/)\nWeb APIs.\n\nLicense\n-------\n\n Apache License, Version 2.0\n\nSource Code\n-----------\n\n https://github.com/authlete/authlete-python\n\nPyPI (Python Package Index)\n---------------------------\n\n https://pypi.org/project/authlete/\n\nInstall\n-------\n\n pip install authlete\n\nQuick Start\n-----------\n\nThe following code simulates \"Authorization Code Flow\". Replace `CLIENT_ID`,\n`SERVICE_API_KEY` and `SERVICE_API_SECRET` in the code with your own properly.\nThe code assumes that the client type of the client application is 'public'\n(otherwise client authentication would be required at the token endpoint) and\nthe number of registered redirect URIs is one (otherwise `redirect_uri` request\nparameter would be required).\n\n```python\nfrom authlete.api import *\nfrom authlete.conf import *\nfrom authlete.dto import *\n\n\n#--------------------------------------------------\n# Your Configuration\n#--------------------------------------------------\nauthlete_api_server = 'https://api.authlete.com'\nservice_api_key = 'SERVICE_API_KEY'\nservice_api_secret = 'SERVICE_API_SECRET'\nclient_id = 'CLIENT_ID'\nuser_id = 'USER_ID'\n\n\n#--------------------------------------------------\n# AuthleteApi\n#--------------------------------------------------\n\n# Configuration to access Authlete APIs.\ncnf = AuthleteConfiguration()\ncnf.baseUrl = authlete_api_server\ncnf.serviceApiKey = service_api_key\ncnf.serviceApiSecret = service_api_secret\n\n# Authlete API caller\napi = AuthleteApiImpl(cnf)\n\n\n#--------------------------------------------------\n# /api/auth/authorization API\n#--------------------------------------------------\n\n# Prepare a request to /api/auth/authorization API.\nreq = AuthorizationRequest()\nreq.parameters = 'response_type=code&client_id={}'.format(client_id)\n\n# Call /api/auth/authorization API. The class of the\n# response is authlete.dto.AuthorizationResponse.\nres = api.authorization(req)\n\n\n#--------------------------------------------------\n# /api/auth/authorization/issue API\n#--------------------------------------------------\n\n# Prepare a request to /api/auth/authorization/issue API.\nreq = AuthorizationIssueRequest()\nreq.ticket = res.ticket\nreq.subject = user_id\n\n# Call /api/auth/authorization/issue API. The class of the\n# response is authlete.dto.AuthorizationIssueResponse.\nres = api.authorizationIssue(req)\n\n# An authorization response returned to the user agent.\nprint('HTTP/1.1 302 Found')\nprint('Location: {}'.format(res.responseContent))\n\n\n#--------------------------------------------------\n# /api/auth/token API\n#--------------------------------------------------\n\n# Prepare a request to /api/auth/token API.\nreq = TokenRequest()\nreq.parameters = 'client_id={}&grant_type=authorization_code&code={}'\\\n .format(client_id, res.authorizationCode)\n\n# Call /api/auth/token API. The class of the response is\n# authlete.dto.TokenResponse.\nres = api.token(req)\n\n# A token response returned to the client.\nprint(\"\\nHTTP/1.1 200 OK\")\nprint(\"Content-Type: application/json\\n\")\nprint(res.responseContent)\n```\n\nDescription\n-----------\n\n#### How To Get AuthleteApi\n\nAll the methods to communicate with Authlete Web APIs are gathered in\n`authlete.api.AuthleteApi` interface. `authlete.api.AuthleteApiImpl` class is\nthe only implementation of the interface. The constructor of `AuthleteApiImpl`\nclass requires an instance of `authlete.conf.AuthleteConfiguration` class.\n\n```python\n# Prepare an instance of AuthleteConfiguration.\ncnf = AuthleteConfiguration()\ncnf.baseUrl = ...\ncnf.serviceOwnerApiKey = ...\ncnf.serviceOwnerApiSecret = ...\ncnf.serviceApiKey = ...\ncnf.serviceApiSecret = ...\n\n# Get an implementation of AuthleteApi interface.\napi = AuthleteApiImpl(cnf)\n```\n\n`AuthleteConfiguration` class has two subclasses, `AuthleteEnvConfiguration`\nand `AuthleteIniConfiguration`.\n\n`AuthleteEnvConfiguration` class reads settings from the following environment\nvariables.\n\n- `AUTHLETE_BASE_URL`\n- `AUTHLETE_SERVICEOWNER_APIKEY`\n- `AUTHLETE_SERVICEOWNER_APISECRET`\n- `AUTHLETE_SERVICE_APIKEY`\n- `AUTHLETE_SERVICE_APISECRET`\n\nThe constructor of `AuthleteEnvConfiguration` reads the environment variables,\nso what you have to do in Python code is just to create an instance of the\nclass as follows.\n\n```python\ncnf = AuthleteEnvConfiguration()\n```\n\nOn the other hand, `AuthleteIniConfiguration` class reads an INI file. The\nformat of the file `AuthleteIniConfiguration` expects is as follows.\n\n```ini\n[authlete]\nbase_url = ...\nservice_owner.api_key = ...\nservice_owner.api_secret = ...\nservice.api_key = ...\nservice.api_secret = ...\n```\n\nThe constructor of `AuthleteIniConfiguration` accepts an optional parameter\nwhich represents the name of an INI file. If the parameter is omitted,\n`authlete.ini` is used as the default file. If the name of your INI file is\nnot `authlete.ini`, pass the file name to the constructor explicitly as follows.\n\n```python\ncnf = AuthleteIniConfiguration('configuration.ini')\n```\n\n#### AuthleteApi Settings\n\n`getSettings()` method of `AuthleteApi` interface returns an instance of\n`authlete.api.Settings` class. You can set connection timeout and read timeout\nvia the instance.\n\n```python\nsettings = api.getSettings()\nsettings.connectionTimeout = 5.0\nsettings.readTimeout = 5.0\n```\n\n#### AuthleteApi Method Categories\n\nMethods in `AuthleteApi` interface can be divided into some categories.\n\n##### Methods for Authorization Endpoint Implementation\n\n- `authorization(request)`\n- `authorizationFail(equest)`\n- `authorizationIssue(request)`\n\n##### Methods for Token Endpoint Implementation\n\n- `token(request)`\n- `tokenFail(request)`\n- `tokenIssue(request)`\n\n##### Methods for Service Management\n\n- `createService(service)`\n- `deleteService(serviceApiKey)`\n- `getService(serviceApiKey)`\n- `getServiceList(start=None, end=None)`\n- `updateService(service)`\n\n##### Methods for Client Application Management\n\n- `createClient(client)`\n- `deleteClient(clientId)`\n- `getClient(clientId)`\n- `getClientList(developer=None, start=None, end=None)`\n- `updateClient(client)`\n- `refreshClientSecret(clientId)`\n- `updateClientSecret(clientId, clientSecret)`\n\n##### Methods for Access Token Introspection\n\n- `introspection(request)`\n- `standardIntrospection(request)`\n- `getTokenList(clientIdentifier=None, subject=None, start=None, end=None)`\n\n##### Methods for Revocation Endpoint Implementation\n\n- `revocation(request)`\n\n##### Methods for User Info Endpoint Implementation\n\n- `userinfo(request)`\n- `userinfoIssue(request)`\n\n##### Methods for JWK Set Endpoint Implementation\n\n- `getServiceJwks(pretty=True, includePrivateKeys=False)`\n\n##### Methods for OpenID Connect Discovery\n\n- `getServiceConfiguration(pretty=True)`\n\n##### Methods for Token Operations\n\n- `tokenCreate(request)`\n- `tokenUpdate(request)`\n\n##### Methods for Requestable Scopes per Client (deprecated; Client APIs suffice)\n\n- `getRequestableScopes(clientId)`\n- `setRequestableScopes(clientId, scopes)`\n- `deleteRequestableScopes(clientId)`\n\n##### Methods for Records of Granted Scopes\n\n- `getGrantedScopes(clientId, subject)`\n- `deleteGrantedScopes(clientId, subject)`\n\n##### Methods for Authorization Management on a User-Client Combination Basis\n\n- `deleteClientAuthorization(clientId, subject)`\n- `getClientAuthorizationList(request)`\n- `updateClientAuthorization(clientId, request)`\n\n##### Methods for JOSE\n\n- `verifyJose(request)`\n\n##### Methods for CIBA (Client Initiated Backchannel Authentication)\n\n- `backchannelAuthentication(request)`\n- `backchannelAuthenticationIssue(request)`\n- `backchannelAuthenticationFail(request)`\n- `backchannelAuthenticationComplete(request)`\n\n##### Methods for OpenID Connect Dynamic Client Registration\n\n- `dynamicClientRegister(request)`\n- `dynamicClientGet(request)`\n- `dynamicClientUpdate(request)`\n- `dynamicClientDelete(request)`\n\n##### Methods for Device Flow\n\n- `deviceAuthorization(request)`\n- `deviceComplete(request)`\n- `deviceVerification(request)`\n\nAuthlete Version\n----------------\n\nSome APIs and features don't work (even if they are defined in the `AuthleteApi`\ninterface) if Authlete API server you use doesn't support them. For example,\nCIBA works only in Authlete 2.1 onwards. Please contact us if you want to use\nnewer Authlete versions.\n\nFeatures available in Authlete 2.0 and onwards:\n\n- Financial-grade API (FAPI)\n- OAuth 2.0 Mutual TLS Client Authentication and Certificate Bound Access Tokens (MTLS)\n- JWT-based Client Authentication (RFC 7523)\n- Scope attributes\n- UK Open Banking Security Profile\n\nFeatures available in Authlete 2.1 and onwards:\n\n- Client Initiated Backchannel Authentication (CIBA)\n- JWT Secured Authorization Response Mode for OAuth 2.0 (JARM)\n- Dynamic Client Registration (RFC 7591 & RFC 7592)\n- OAuth 2.0 Device Authorization Grant (Device Flow)\n- JWT-based Access Token\n\nSee Also\n--------\n\n- [authlete-python-django](https://github.com/authlete/authlete-python-django/) : Authlete library for Django\n- [django-oauth-server](https://github.com/authlete/django-oauth-server/) : Authorization server implementation using Django\n- [django-resource-server](https://github.com/authlete/django-resource-server/) : Resource server implementation using Django\n\nContact\n-------\n\nContact Form : https://www.authlete.com/contact/\n\n| Purpose | Email Address |\n|:----------|:---------------------|\n| General | info@authlete.com |\n| Sales | sales@authlete.com |\n| PR | pr@authlete.com |\n| Technical | support@authlete.com |\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/authlete/authlete-python", "keywords": "", "license": "Apache License, Version 2.0", "maintainer": "", "maintainer_email": "", "name": "authlete", "package_url": "https://pypi.org/project/authlete/", "platform": "", "project_url": "https://pypi.org/project/authlete/", "project_urls": { "Homepage": "https://github.com/authlete/authlete-python" }, "release_url": "https://pypi.org/project/authlete/1.0.2/", "requires_dist": [ "requests" ], "requires_python": "", "summary": "Python library for Authlete", "version": "1.0.2" }, "last_serial": 5654396, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "c31a344478e491220c25115f0b3508d3", "sha256": "a6fb71b2b943f19b02f532b6c5228eb3f39339b745ba68fe807dc294e35ba02a" }, "downloads": -1, "filename": "authlete-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "c31a344478e491220c25115f0b3508d3", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 106999, "upload_time": "2019-07-29T19:57:23", "url": "https://files.pythonhosted.org/packages/80/a5/508f2eb4effbcb7520efe8d04495c33cf8163eb94d49f7a2b855ccc24af7/authlete-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "be7c7c785a87c9836f1455eaeab2c2f2", "sha256": "863a0cefb60c072f32873bf83e6a3d6794e126b3342195ad623d8e882ad6f6e1" }, "downloads": -1, "filename": "authlete-1.0.0.tar.gz", "has_sig": false, "md5_digest": "be7c7c785a87c9836f1455eaeab2c2f2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 27461, "upload_time": "2019-07-29T19:57:26", "url": "https://files.pythonhosted.org/packages/2e/49/f271de2a09ddfb042c75f4d0b4d09bfe05349b23f4c980b65bd7a0d6ab52/authlete-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "19d7387957ba129143b8ef3124484acf", "sha256": "7cb1ca53c95ca46d551b2e851fe44b782eba029dc47337518c8987e68e5ae905" }, "downloads": -1, "filename": "authlete-1.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "19d7387957ba129143b8ef3124484acf", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 107022, "upload_time": "2019-08-02T19:16:09", "url": "https://files.pythonhosted.org/packages/f3/f9/5432ffe23e26c12ee8a19b0db9282459a562e3627b356d5e829d334b78f9/authlete-1.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "fd850b9b755aff9dfe905b887dc9e8b7", "sha256": "9819a9ce9ad487f2cf897c4276dae24144df07128aea44874dfbad4b075cd07e" }, "downloads": -1, "filename": "authlete-1.0.1.tar.gz", "has_sig": false, "md5_digest": "fd850b9b755aff9dfe905b887dc9e8b7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 27897, "upload_time": "2019-08-02T19:16:10", "url": "https://files.pythonhosted.org/packages/9e/39/f31c5f9683bd4ca4f7ffb614bbe4250869f1c6a0155c03fedbdd08ff4518/authlete-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "d5ccd73ea4c2b53bdccb932d72132e42", "sha256": "6b0d49bc248a1bb083fa4f9a0de10e5e5ed3686506b243e94484380581de1cf9" }, "downloads": -1, "filename": "authlete-1.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "d5ccd73ea4c2b53bdccb932d72132e42", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 107089, "upload_time": "2019-08-09T09:10:43", "url": "https://files.pythonhosted.org/packages/b2/11/5444c851fedb4b4d34ed00c6d34a32f69359a3087b90fc03acb837420968/authlete-1.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4c3757615cd20b6d06cc17487d765566", "sha256": "54657bf5945ef14e0044573dad72710315b53c2f230ab6e487282d117312c1c1" }, "downloads": -1, "filename": "authlete-1.0.2.tar.gz", "has_sig": false, "md5_digest": "4c3757615cd20b6d06cc17487d765566", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 28087, "upload_time": "2019-08-09T09:10:45", "url": "https://files.pythonhosted.org/packages/e8/2a/46a427aee4d0e47939f19f2febbd78c22a2f39de63464c87136a23091981/authlete-1.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "d5ccd73ea4c2b53bdccb932d72132e42", "sha256": "6b0d49bc248a1bb083fa4f9a0de10e5e5ed3686506b243e94484380581de1cf9" }, "downloads": -1, "filename": "authlete-1.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "d5ccd73ea4c2b53bdccb932d72132e42", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 107089, "upload_time": "2019-08-09T09:10:43", "url": "https://files.pythonhosted.org/packages/b2/11/5444c851fedb4b4d34ed00c6d34a32f69359a3087b90fc03acb837420968/authlete-1.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4c3757615cd20b6d06cc17487d765566", "sha256": "54657bf5945ef14e0044573dad72710315b53c2f230ab6e487282d117312c1c1" }, "downloads": -1, "filename": "authlete-1.0.2.tar.gz", "has_sig": false, "md5_digest": "4c3757615cd20b6d06cc17487d765566", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 28087, "upload_time": "2019-08-09T09:10:45", "url": "https://files.pythonhosted.org/packages/e8/2a/46a427aee4d0e47939f19f2febbd78c22a2f39de63464c87136a23091981/authlete-1.0.2.tar.gz" } ] }