onelogin
OneLogin API Python SDK
What it is and what it does
The onelogin package is the official Python SDK for OneLogin's REST API. It wraps OAuth2 client-credentials authentication and provides typed API clients for managing users, roles, groups, and applications within a OneLogin tenant. The SDK uses Pydantic for request/response validation and urllib3 for HTTP transport, making it straightforward to integrate OneLogin identity operations into Python applications.
Typical usage involves creating a Configuration object with your OneLogin subdomain and API credentials, exchanging those credentials for an OAuth2 access token, and then instantiating API client objects (UsersV2Api, RolesApi, etc.) to perform CRUD operations. The SDK is actively maintained and supports current Python versions; it requires Python 3.10+ and enforces Pydantic 2.11+ to avoid validation-layer incompatibilities.
Use it for:
- Automate user provisioning and deprovisioning workflows by creating, updating, or deleting users and group memberships programmatically.
- Build identity-aware applications that query OneLogin for user roles and group membership to enforce access control.
- Migrate users or configuration data between OneLogin tenants or from legacy systems into OneLogin.
- Monitor and audit OneLogin resources (users, roles, apps) by fetching and analyzing their current state.
- Integrate OneLogin authentication into CI/CD pipelines or infrastructure-as-code tools for role-based access management.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Official Python SDK for OneLogin's API, enabling programmatic management of users, roles, groups, apps, and OAuth2 authentication against OneLogin's identity platform.
Yes, if you are actively using OneLogin and need to manage identity resources programmatically. The SDK is actively maintained, has low install friction, and provides a clean Pydantic-based interface to OneLogin's API. Verify the license terms before adopting in a commercial context, and confirm that your OneLogin API credentials carry the required scopes for your use case.
Install
onelogin on PyPI
pip
pip install oneloginuv
uv add oneloginpoetry
poetry add oneloginInstalling onelogin
Before you install
Low install friction with a pure-Python wheel. Actively maintained with a release 43 days ago. Requires Python 3.10+ and Pydantic 2.11+; the Pydantic constraint is enforced and documented, reducing version-mismatch surprises.
License in practice
License treatment is unclear (marked 'NoLicense' with no SPDX identifier). Before adopting in a commercial or copyleft context, verify the actual license terms in the repository or contact the maintainers.
Quickstart
pip install onelogin
import os
import onelogin
configuration = onelogin.Configuration(
host="https://your-subdomain.onelogin.com",
username=os.environ["ONELOGIN_CLIENT_ID"],
password=os.environ["ONELOGIN_CLIENT_SECRET"],
)
with onelogin.ApiClient(configuration) as api_client:
token_api = onelogin.OAuth2Api(api_client)
token = token_api.generate_token({"grant_type": "client_credentials"})
configuration.access_token = token.access_token
users_api = onelogin.UsersV2Api(api_client)
users_api.list_users2()
Requires Python 3.10+, Pydantic 2.11+, and valid OneLogin API credentials (Client ID and Client Secret) with appropriate scopes from the OneLogin admin portal.
Verify before relying
- Whether the 'NoLicense' designation reflects a missing license file, a proprietary license, or an oversight in metadata.
- Scope and rate limits of the OneLogin API itself (not documented in the SDK excerpt).
- Whether all OneLogin API endpoints are covered by the SDK or if direct HTTP calls are sometimes necessary.
Package facts
| License | NoLicense (unclear) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 5 — urllib3, python-dateutil, pydantic, aenum, setuptools |
| Maintenance | actively maintained — 43 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 166,381/month — #10,495 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: onelogin-4.0.1-py3-none-any.whl
Keywords: OneLogin, SDK, API
Tags
More Internet packages
Botocore provides low-level, data-driven access…
permissive · top 100 on PyPI
aiobotocoreProvides an async client for AWS services using…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
filelockProvides a platform-independent file locking…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
googleapis-common-protosProvides common Protocol Buffer message…
permissive · top 100 on PyPI
onfido-pythonOfficial Python client library for the Onfido…
permissive · top 5,000 on PyPI
openfga-sdkPython SDK for OpenFGA that wraps the OpenFGA…
permissive · top 5,000 on PyPI
coze-workload-identityImplements OAuth2.0 token exchange…
permissive · top 15,000 on PyPI
asanaPython client library for the Asana REST API,…
permissive · top 5,000 on PyPI
python3-samlTurns a Python application into a SAML 2.0…
permissive · top 5,000 on PyPI
authentik-clientA Python client library for the authentik…
permissive · top 15,000 on PyPI
oauth2-clientHandles OAuth2 authentication flows…
unclear · top 15,000 on PyPI
oktaA Python SDK for the Okta Management APIs,…
permissive · top 5,000 on PyPI
foundry-platform-sdkA Python client library for the Foundry API…
permissive · top 5,000 on PyPI
propelauth-pyValidates access tokens and manages user…
permissive · top 15,000 on PyPI