{"id":27634746,"url":"https://github.com/one-click-auth/trustauthx-py-sdk","last_synced_at":"2026-03-10T18:03:42.124Z","repository":{"id":182040076,"uuid":"667849115","full_name":"One-Click-Auth/TrustAuthx-Py-SDK","owner":"One-Click-Auth","description":"It is the official Python SDK for TrustAuthx. ","archived":false,"fork":false,"pushed_at":"2024-07-06T17:46:12.000Z","size":184,"stargazers_count":4,"open_issues_count":31,"forks_count":6,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-01T13:47:26.498Z","etag":null,"topics":["authentication","django","fastapi","flask","oauth","pypi","python","python3","sdk","trustauthx"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/trustauthx/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/One-Click-Auth.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-07-18T12:46:22.000Z","updated_at":"2024-05-03T17:39:12.000Z","dependencies_parsed_at":"2024-04-05T17:35:23.083Z","dependency_job_id":"95cddb4e-b2c2-420d-b436-e1fd38148e3f","html_url":"https://github.com/One-Click-Auth/TrustAuthx-Py-SDK","commit_stats":null,"previous_names":["one-click-auth/trustauthx-py-sdk"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/One-Click-Auth/TrustAuthx-Py-SDK","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/One-Click-Auth%2FTrustAuthx-Py-SDK","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/One-Click-Auth%2FTrustAuthx-Py-SDK/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/One-Click-Auth%2FTrustAuthx-Py-SDK/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/One-Click-Auth%2FTrustAuthx-Py-SDK/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/One-Click-Auth","download_url":"https://codeload.github.com/One-Click-Auth/TrustAuthx-Py-SDK/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/One-Click-Auth%2FTrustAuthx-Py-SDK/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30346484,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T15:55:29.454Z","status":"ssl_error","status_checked_at":"2026-03-10T15:54:58.440Z","response_time":106,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["authentication","django","fastapi","flask","oauth","pypi","python","python3","sdk","trustauthx"],"created_at":"2025-04-23T19:24:20.535Z","updated_at":"2026-03-10T18:03:42.105Z","avatar_url":"https://github.com/One-Click-Auth.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"It is the official Python SDK for TrustAuthx. \n\n# TrustAuthX Python Connector SDK 🐍\n\nTrustAuthX is a revolutionary AI-powered authentication platform that provides secure and seamless login experiences for your users. TrustAuthX uses a unique neuroform technology that analyzes the biometric and behavioral patterns of your users and verifies their identity in real time.\n\nWith TrustAuthX Python Connector SDK, you can easily integrate TrustAuthX authentication into your Python web applications. This SDK contains two components:\n\n- **AuthLite**: A lightweight and simple interface that allows you to use TrustAuthX as a standalone authentication service. AuthLite handles the communication between your app and TrustAuthX servers, and provides you with a user-friendly UI for login and registration.\n- **Standard**: A powerful and flexible interface that allows you to use TrustAuthX as a complementary authentication layer on top of your existing authentication system. Standard gives you full control over the customization and configuration of TrustAuthX authentication, and supports more than 20 popular Python web frameworks.\n\n## Getting Started 🚀\n\nTo use TrustAuthX Python Connector SDK, you need to have a TrustAuthX account and credentials. You can create them for free on the [TrustAuthX app website].\n\nOnce you have your credentials, you can install the SDK using pip:\n\n```bash\npip install trustauthx\n```\n\nYou got it. I will add the following section under the Quick Start heading:\n\n## Quick Start With AI 🚀\n\nIf you want to experience the magic of TrustAuthX neuroform technology, you can use our CLI command to create a fully functional web app with TrustAuthX authentication in seconds. Just run:\n\n```bash\ntrustauthx neuroform \u003cframework\u003e\n```\n\nwhere `\u003cframework\u003e` is the name of your preferred Python web framework. For example, if you want to use Flask, you can run:\n\n```bash\ntrustauthx neuroform flask\n```\n\nThis will generate a Flask app with TrustAuthX authentication already integrated. You can then run the app and test it out. TrustAuthX neuroform will automatically analyze your framework and implement the best practices for TrustAuthX authentication. You don't need to write any code or configure any settings. TrustAuthX neuroform does it all for you. It's like having an AI assistant that builds your authentication system for you. How cool is that? 😎\n\nFor more details on how to use the neuroform CLI command, please refer to the [TrustAuthX documentation].\n\n\n## Quick Start With Advance Usage \u0026 Customizations.\n\nThen, you can import the SDK in your Python code:\n\n```python\nimport trustauthx\n```\n\nDepending on your use case, you can choose to use either AuthLite or Standard interface. For more details on how to use them, please refer to the [TrustAuthX documentation].\n\n## Examples 📝\n\nHere are some examples of how to use TrustAuthX Python Connector SDK with different web frameworks:\n\n- Flask\n\n```python\nfrom flask import Flask, request, redirect, session\nfrom trustauthx.authlite import AuthLiteClient\n\n\napp = Flask(__name__)\napp.secret_key = \"your_secret_key\"\n\nauth_lite_client = AuthLiteClient(api_key=\"f28ffe7f2e4a47d6a796b0c2df073aeeAVVQBFSSCXIQWNQIEPBI\", \n                        secret_key=\"8ad9741c8fd5a8f286fc34eba21e0871e63dff3dd67e3ea3a1b43077db9531f7\", \n                        org_id=\"c3621ed40ccc4fca955779fab8f776c921e8865e439211ee88069dc8f7663e88\")\n\ndef get_auth_():\n    access_token = session.get(\"access_token\")\n    refresh_token = session.get(\"refresh_token\")\n    try:\n        a = auth_lite_client.validate_token_set(access_token=access_token, refresh_token=refresh_token)\n        if not a.state:\n            session[\"access_token\"] = a.access\n            session[\"refresh_token\"] = a.refresh\n            t=\"Token Regenerated refresh Token Valid\" \n        else:t=\"Access Token Valid\"\n        return t\n    except Exception as e:\n        return redirect(auth_lite_client.generate_url())\n\n@app.route(\"/\")\ndef root():\n    return redirect(auth_lite_client.generate_url())\n\n@app.route(\"/user\")\ndef get_user():\n    code = request.args.get('code')\n    try:\n        user = auth_lite_client.get_user(code)\n        session[\"access_token\"] = user['access_token']\n        session[\"refresh_token\"] = user['refresh_token']\n        return {\"user\": user}\n    except:\n        return {\"error\": \"Bad Request\"}, 400\n\n@app.route(\"/user-update\")\ndef update_user():\n    try:\n        access_token = session.get(\"access_token\")\n        return redirect(auth_lite_client.generate_edit_user_url(access_token, url =\"http://127.0.0.1:3535/re-auth\"))\n    except:\n        return {\"error\": \"Bad Request\"}, 400\n\n@app.route(\"/re-auth\")\ndef re_auth():\n    code = request.args.get('code')\n    try:\n        user = auth_lite_client.re_auth(code)\n        session[\"access_token\"] = user['access_token']\n        session[\"refresh_token\"] = user['refresh_token']\n        return {\"user\": user}\n    except:\n        return redirect(\"http://127.0.0.1:3535/validate-token\")\n\n@app.route(\"/validate-token\")\ndef validate_access_token():\n    token_validator = get_auth_()\n    return token_validator\n\ndef revoketokens():\n    try:\n        return auth_lite_client.revoke_token(AccessToken=session.get(\"access_token\"), revoke_all_tokens=True)\n    except:\n        return redirect(auth_lite_client.generate_url())\n\ndef revokeAccesstokens():\n    try:\n        return auth_lite_client.revoke_token(AccessToken=session.get(\"access_token\"))\n    except:\n        return redirect(auth_lite_client.generate_url())\n\n@app.route(\"/sign-out\")\ndef invalidate_all_token():\n    r = revoketokens()\n    return redirect(\"http://127.0.0.1:3535/validate-token\")\n\n@app.route(\"/semi-sign-out\")\ndef invalidate_access_token():\n    r = revokeAccesstokens()\n    return \"revoked access token\"\n\nif __name__ == \"__main__\":\n    app.run(port=3535)\n\n```\n\n- Django\n\n```python\nfrom django.shortcuts import render, redirect\nfrom django.http import JsonResponse, HttpResponseBadRequest\nfrom django.contrib.sessions.backends.db import SessionStore\nfrom trustauthx.authlite import AuthLiteClient\n\nauth_lite_client = AuthLiteClient(api_key=\"f28ffe7f2e4a47d6a796b0c2df073aeeAVVQBFSSCXIQWNQIEPBI\", \n                        secret_key=\"8ad9741c8fd5a8f286fc34eba21e0871e63dff3dd67e3ea3a1b43077db9531f7\", \n                        org_id=\"c3621ed40ccc4fca955779fab8f776c921e8865e439211ee88069dc8f7663e88\")\n\ndef get_auth_(request):\n    access_token = request.session.get(\"access_token\")\n    refresh_token = request.session.get(\"refresh_token\")\n    try:\n        a = auth_lite_client.validate_token_set(access_token=access_token, refresh_token=refresh_token)\n        if not a.state:\n            request.session[\"access_token\"] = a.access\n            request.session[\"refresh_token\"] = a.refresh\n            t=\"Token Regenerated refresh Token Valid\" \n        else:t=\"Access Token Valid\"\n        return t\n    except Exception as e:\n        return redirect(auth_lite_client.generate_url())\n\ndef root(request):\n    return redirect(auth_lite_client.generate_url())\n\ndef get_user(request):\n    code = request.GET.get('code')\n    try:\n        user = auth_lite_client.get_user(code)\n        request.session[\"access_token\"] = user['access_token']\n        request.session[\"refresh_token\"] = user['refresh_token']\n        return JsonResponse({\"user\": user})\n    except:\n        return HttpResponseBadRequest()\n\ndef update_user(request):\n    try:\n        access_token = request.session.get(\"access_token\")\n        return redirect(auth_lite_client.generate_edit_user_url(access_token, url =\"http://127.0.0.1:3535/re-auth\"))\n    except:\n        return HttpResponseBadRequest()\n\ndef re_auth(request):\n    code = request.GET.get('code')\n    try:\n        user = auth_lite_client.re_auth(code)\n        request.session[\"access_token\"] = user['access_token']\n        request.session[\"refresh_token\"] = user['refresh_token']\n        return JsonResponse({\"user\": user})\n    except:\n        return redirect(\"http://127.0.0.1:3535/validate-token\")\n\ndef validate_access_token(request):\n    token_validator = get_auth_(request)\n    return JsonResponse(token_validator)\n\ndef revoketokens(request):\n    try:\n        return auth_lite_client.revoke_token(AccessToken=request.session.get(\"access_token\"), revoke_all_tokens=True)\n    except:\n        return redirect(auth_lite_client.generate_url())\n\ndef revokeAccesstokens(request):\n    try:\n        return auth_lite_client.revoke_token(AccessToken=request.session.get(\"access_token\"))\n    except:\n        return redirect(auth_lite_client.generate_url())\n\ndef invalidate_all_token(request):\n    r = revoketokens(request)\n    return r\n\ndef invalidate_access_token(request):\n    r = revokeAccesstokens(request)\n    return r\n```\n\nFor more examples and tutorials, please visit the [TrustAuthX documentation].\n\n## Support 💬\n\nIf you have any questions, feedback, or issues, please feel free to contact us at support@trustauthx.com. We are always happy to hear from you and help you with your integration.\n\n## License 📄\n\nTrustAuthX Python Connector SDK is licensed under the MIT License. See the [LICENSE] file for more details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fone-click-auth%2Ftrustauthx-py-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fone-click-auth%2Ftrustauthx-py-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fone-click-auth%2Ftrustauthx-py-sdk/lists"}