{ "info": { "author": "Edward Guan", "author_email": "eguan@logonlabs.com", "bugtrack_url": null, "classifiers": [ "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# LogonLabs Python\n\nThe official LogonLabs Python library.\n## Download\n- First time install\n```\n pip install logonlabs-python\n```\n- If you have installed the package already, please upgrade it.\n```\n pip install --upgrade logonlabs-python\n```\n## LogonLabs API\n\n- Prior to coding, some configuration is required at https://app.logonlabs.com/app/#app-settings\n\n- For the full Developer Documentation please visit: https://app.logonlabs.com/api/\n\n---\n### Instantiating a new client\n\n- Your `APP_ID` can be found in [App Settings](https://app.logonlabs.com/app/#/app-settings).\n- `APP_SECRETS` are configured [here](https://app.logonlabs.com/app/#/app-secrets).\n- The `LOGONLABS_API_ENDPOINT` should be set to `https://api.logonlabs.com`.\n\nCreate a new instance of `LogonClient`. \n```python\nfrom logonlabs.client import Logonlabs\n\nlogonClient = Logonlabs('{APP_ID}', '{APP_SECRETS}', '{LOGONLABS_API_ENDPOINT}')\n\n```\n---\n### SSO Login QuickStart\nThe StartLogin function in the JS library begins the LogonLabs managed SSO process.\n>Further documentation on starting the login process via our JavaScript client can be found at our GitHub page [here](https://github.com/logonlabs/logonlabs-js). \nThe following example demonstrates what to do once the `callback Url` has been used by our system to redirect the user back to your page:\n```python\nrequest_headers = self.headers\ntoken = request_headers[\"token\"]\nresponse = logonClient.validateLogin(token)\ndata = response.json()\nif data['event_success']:\n #authentication and validation succeeded. proceed with post-auth workflows (ie, create a user session token for your system).\n```\n---\n### Python Only Workflow\nThe following workflow is required if you're using Python to process all transaction requests. If this does not apply to you, please refer to the SSO Login QuickStart section.\n#### Step 1 - StartLogin\nThis call begins the LogonLabs managed SSO process. The `client_data` property is optional and is used to pass any data that is required after validating the request. The `tags` property is an Array of type Tag which is a simple object representing a key/value pair.\n```python\n\nidentity_provider = '{string}' # one of the following ['microsoft','google','facebook','linkedin','slack','twitter','github','quickbooks','onelogin','okta','apple','basecamp','dropbox','fitbit','planningcenter','twitch']\nidentity_provider_id = '{string}' # require identity_provider or identity_provider_id\nclient_data = '{string}'\ntags = [{'example-key': 'example-value'}]\nredirect = False\ncallback_url = 'https://example.com'\ndestination_url = 'https://example.com'\nresponse = logonClient.startLogin(identity_provider, identity_provider_id, \"example@emailaddress.com\", client_data, callback_url, destination_url, tags)\nredirect_url = response.url\n```\n\nThe `redirect_url` property returned should be redirected to by the application. Upon submitting their credentials, users will be redirected to the `callback_url` set within the application settings at https://logonlabs.com/app/#/app-settings.\n \n#### Step 2 - ValidateLogin\nThis method is used to validate the results of the login attempt. `query_token` corresponds to the query parameter with the name `token` appended to the callback url specified for your app.\nThe response contains all details of the login and the user has now completed the SSO workflow. If there is any additional information to add, UpdateEvent can be called on the `event_id` returned.\n```python\n\nresponse = logonClient.validateLogin('{token}')\ndata = response.json()\nif data['event_success']:\n #success\nelse:\n validation_details = data['validation_details']\n if validation_details['domain_validation'] == 'Fail':\n #provider used was not enabled for the domain of the user that was authenticated\n\n if validation_details['ip_validation'] == 'Fail' or validation_details['geo_validation'] == 'Fail' or validation_details['time_validation'] == 'Fail':\n #validation failed via restriction settings for the app\n```\n---\n### CreateEvent\nThe CreateEvent method allows one to create events that are outside of our SSO workflows.\n```python\n\nlocal_validation = '{string}' # one of the following ['Pass', 'Fail', 'NotApplicable']\ntags = [{'example-key': 'example-value'}]\nevent_type = '{string}' # one of the following ['LocalLogin', 'LocalLogout']\n\nresponse = logonClient.createEvent(event_type, True, local_validation, \"{EMAIL_ADDRESS}\", \"{IP_ADDRESS}\", \"{USER_AGENT}\", \"{FIRST_NAME}\", \"{LAST_NAME}\", tags)\n```\n---\n### Helper Methods\n#### GetProviders\nThis method is used to retrieve a list of all providers enabled for the application.\nIf an email address is passed to the method, it will return the list of providers available for that email domain.\n```python\nresponse = logonClient.getProviders(\"example@emailaddress.com\")\ndata = response.json()\nsocial_identity_providers = data['social_identity_providers']\nfor provider in social_identity_providers:\n #each individual providers available for this email address\n\nenterprise_identity_providers = data['enterprise_identity_providers']\nfor enterpriseProvider in enterprise_identity_providers:\n #each enterprise providers available for this email address\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/logonlabs/logonlabs-python", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "logonlabs-python", "package_url": "https://pypi.org/project/logonlabs-python/", "platform": "", "project_url": "https://pypi.org/project/logonlabs-python/", "project_urls": { "Homepage": "https://github.com/logonlabs/logonlabs-python" }, "release_url": "https://pypi.org/project/logonlabs-python/1.5.2/", "requires_dist": null, "requires_python": "", "summary": "Logonlabs Python package", "version": "1.5.2" }, "last_serial": 5985901, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "bb456f8ea3828e18e8cb2fb805d4ce6c", "sha256": "37f1b2b4f6704a1faa5efb07dcfdc8dba30b6afca33dbece91850816d28f9ade" }, "downloads": -1, "filename": "logonlabs_python-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "bb456f8ea3828e18e8cb2fb805d4ce6c", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6078, "upload_time": "2019-06-25T18:32:00", "url": "https://files.pythonhosted.org/packages/53/2d/f2d47a5b5e32e0485f11b9fb272c4b39dda1b1b0dfd37506102d4d0fede7/logonlabs_python-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "70b77feaa60aa9916e00e0c739c7c189", "sha256": "786fadf5d373811d2a9d2b19345eaac5510dbe065bbf31a58b5c8b7675b752cd" }, "downloads": -1, "filename": "logonlabs-python-1.0.0.tar.gz", "has_sig": false, "md5_digest": "70b77feaa60aa9916e00e0c739c7c189", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5059, "upload_time": "2019-06-25T18:32:02", "url": "https://files.pythonhosted.org/packages/0d/78/8ecb47187e8df20ff48192abc3199f7318776e8951c7d4776845cd68b166/logonlabs-python-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "3b656bfba5069fd05485a2defb4b5d95", "sha256": "519561b5e43d5e6165380a9704b8128c48870361a6aca4237c1af59d35e658d7" }, "downloads": -1, "filename": "logonlabs_python-1.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "3b656bfba5069fd05485a2defb4b5d95", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6088, "upload_time": "2019-07-09T18:44:20", "url": "https://files.pythonhosted.org/packages/fd/21/ca42452ef570aec4ae69c99c218118093ab87b17a89ce80e37905da1cfed/logonlabs_python-1.0.1-py3-none-any.whl" } ], "1.5.0": [ { "comment_text": "", "digests": { "md5": "c4d3a630ef6388b8029653031d99717e", "sha256": "9d7f23fddd96b1fa5d2f572c706db1174d3fcb120d5408ae1c28ff4cf9c44a5b" }, "downloads": -1, "filename": "logonlabs_python-1.5.0-py3-none-any.whl", "has_sig": false, "md5_digest": "c4d3a630ef6388b8029653031d99717e", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5938, "upload_time": "2019-10-15T22:20:51", "url": "https://files.pythonhosted.org/packages/5f/cf/e7a97bd7d0f742c374ee878a1f092c258277557f4c0f108718aea16386df/logonlabs_python-1.5.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2fda48d23e37d338e3a249242a568c17", "sha256": "981a5d8119f0852a2ae96afd1f6621311e3b05529e9b24622989a4666a8a413a" }, "downloads": -1, "filename": "logonlabs-python-1.5.0.tar.gz", "has_sig": false, "md5_digest": "2fda48d23e37d338e3a249242a568c17", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4404, "upload_time": "2019-10-15T22:20:54", "url": "https://files.pythonhosted.org/packages/23/e4/4ffbf29b83d62914f6281901e557249905be3763dea523d8853ae0b53fb6/logonlabs-python-1.5.0.tar.gz" } ], "1.5.1": [ { "comment_text": "", "digests": { "md5": "e951c25ea3468a24c89991b571e5ff71", "sha256": "11ee7d75213eeffd3b64588435c45f3b98b6dc8a56c84c3210558b89d752d577" }, "downloads": -1, "filename": "logonlabs_python-1.5.1-py3-none-any.whl", "has_sig": false, "md5_digest": "e951c25ea3468a24c89991b571e5ff71", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5945, "upload_time": "2019-10-16T16:12:02", "url": "https://files.pythonhosted.org/packages/27/f5/2133a4dea4ed78053e458b0a08af66903cb50d98794c62701e08020a1cd1/logonlabs_python-1.5.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3300d6e2c593b162c3bbe58ff3008219", "sha256": "0516db29374c93f15b4a0f7016a7ee705390925b77711020e94af54f3dd0965a" }, "downloads": -1, "filename": "logonlabs-python-1.5.1.tar.gz", "has_sig": false, "md5_digest": "3300d6e2c593b162c3bbe58ff3008219", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4850, "upload_time": "2019-10-16T16:12:04", "url": "https://files.pythonhosted.org/packages/26/23/bcd3c052a0813811d87c3dabcf4423ecf36bd535a4f6c48d696ead5f3a95/logonlabs-python-1.5.1.tar.gz" } ], "1.5.2": [ { "comment_text": "", "digests": { "md5": "f3b61a124ca11d0f94b67d92bbfc4440", "sha256": "ecad55ba15d4fb1f5f1a2a5aa2d4987cecaeb5c96b3802235aab935fa98a1e20" }, "downloads": -1, "filename": "logonlabs_python-1.5.2-py3-none-any.whl", "has_sig": false, "md5_digest": "f3b61a124ca11d0f94b67d92bbfc4440", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6007, "upload_time": "2019-10-16T18:59:17", "url": "https://files.pythonhosted.org/packages/51/64/b1f7491c6467b4244e24d400450ed6354048ae2865b49bc6eee08ca61730/logonlabs_python-1.5.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2cf09c733924b342e43db708fbad6e71", "sha256": "4acb74615fc6eb31160de424fa363d53884bd16b2d240ae5147dac73f04b43d0" }, "downloads": -1, "filename": "logonlabs-python-1.5.2.tar.gz", "has_sig": false, "md5_digest": "2cf09c733924b342e43db708fbad6e71", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4927, "upload_time": "2019-10-16T18:59:19", "url": "https://files.pythonhosted.org/packages/5c/d1/b9c28ce5839ad0bdf02ce5edddac7b7df5055f9056fc0d92cad543de1f1c/logonlabs-python-1.5.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f3b61a124ca11d0f94b67d92bbfc4440", "sha256": "ecad55ba15d4fb1f5f1a2a5aa2d4987cecaeb5c96b3802235aab935fa98a1e20" }, "downloads": -1, "filename": "logonlabs_python-1.5.2-py3-none-any.whl", "has_sig": false, "md5_digest": "f3b61a124ca11d0f94b67d92bbfc4440", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6007, "upload_time": "2019-10-16T18:59:17", "url": "https://files.pythonhosted.org/packages/51/64/b1f7491c6467b4244e24d400450ed6354048ae2865b49bc6eee08ca61730/logonlabs_python-1.5.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2cf09c733924b342e43db708fbad6e71", "sha256": "4acb74615fc6eb31160de424fa363d53884bd16b2d240ae5147dac73f04b43d0" }, "downloads": -1, "filename": "logonlabs-python-1.5.2.tar.gz", "has_sig": false, "md5_digest": "2cf09c733924b342e43db708fbad6e71", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4927, "upload_time": "2019-10-16T18:59:19", "url": "https://files.pythonhosted.org/packages/5c/d1/b9c28ce5839ad0bdf02ce5edddac7b7df5055f9056fc0d92cad543de1f1c/logonlabs-python-1.5.2.tar.gz" } ] }