{"id":21640,"library":"onelogin","title":"OneLogin Python SDK","description":"Official Python SDK for the OneLogin API (v1 and v2). Supports OAuth2 authentication, user and role management, event and factor APIs, and SAML assertion handling. Current version 3.2.5, requires Python >=3.10. Active development with quarterly releases.","status":"active","version":"3.2.5","language":"python","source_language":"en","source_url":"https://github.com/onelogin/onelogin-python-sdk","tags":["onelogin","sso","saml","api-sdk","oauth2","identity-management"],"install":[{"cmd":"pip install onelogin","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"HTTP client used by all API calls","package":"requests","optional":false},{"reason":"Data models for API responses (v2)","package":"pydantic","optional":false},{"reason":"SAML assertion signing/verification","package":"cryptography","optional":true}],"imports":[{"wrong":"from onelogin.api.client import OneLoginClient","symbol":"ApiClient","correct":"from onelogin import ApiClient"}],"quickstart":{"code":"import os\nfrom onelogin.api.client import OneLoginClient\n\nclient = OneLoginClient(\n    client_id=os.environ.get('ONELOGIN_CLIENT_ID', ''),\n    client_secret=os.environ.get('ONELOGIN_CLIENT_SECRET', ''),\n    region='us'\n)\n# Fetch users\nusers = client.get_users()\nprint(f\"Fetched {len(users)} users\")","lang":"python","description":"Initialize the OneLogin client and fetch a list of users."},"warnings":[{"fix":"Use keyword arguments: OneLoginClient(client_id=..., client_secret=..., region='us')","message":"In v3.x, the constructor changed from (region, client_id, client_secret) to (client_id, client_secret, region). Passing positional arguments in the old order will swap credentials.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Use create_user2() and handle the User model returned.","message":"Methods like create_user() are deprecated in favor of create_user2(). The v2 endpoints return different response structures.","severity":"deprecated","affected_versions":">=2.0.0 <4.0.0"},{"fix":"Access attributes via dot notation (e.g., user.email) rather than user['email'].","message":"The library uses Pydantic v2 for data models. Direct dictionary access on responses may fail if you expected simple dicts.","severity":"gotcha","affected_versions":">=3.0.0"},{"fix":"Wrap API calls with token expiry check or call authenticate() before each batch.","message":"OAuth2 access tokens expire after 3600 seconds. The client does not auto-refresh – you must call client.refresh_token() or re-authenticate.","severity":"gotcha","affected_versions":"all"},{"fix":"Migrate to the new client and use v2 endpoints where possible.","message":"In v2.0.0, the SDK was rewritten to support both API /1 and /2. Old v1 SDK scripts (pre-2.0) are not compatible.","severity":"breaking","affected_versions":">=2.0.0"}],"env_vars":null,"search_vec":"'3.10':34 '3.2.5':31 'activ':35 'api':10,24,44 'api-sdk':43 'assert':27 'authent':16 'current':29 'develop':36 'event':21 'factor':23 'handl':28 'ident':48 'identity-manag':47 'manag':20,49 'oauth2':15,46 'offici':4 'onelogin':1,9,40 'python':2,5,33 'quarter':38 'releas':39 'requir':32 'role':19 'saml':26,42 'sdk':3,6,45 'sso':41 'support':14 'user':17 'v1':11 'v2':13 'version':30","created_at":"2026-04-27T17:00:58.199425+00:00","updated_at":"2026-04-27T17:00:58.199425+00:00","problems":null,"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"4.0.0","cli_name":"","cli_version":null,"type":"library","homepage":"https://www.onelogin.com","github":"https://github.com/onelogin/onelogin-python-sdk","docs":null,"changelog":null,"pypi":"https://pypi.org/project/onelogin/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["auth-security","communication"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-30","last_verified":"2026-06-30","next_check":"2026-07-30","install_tag":null}}