Introduction
This guide demonstrates how to build a simple read-only Okta connector using the Lumos Connector SDK. The connector implements user synchronization functionality, mapping Okta user profiles to Lumos account structures. Note: This sample Okta connector has been created for demonstration purposes, Lumos provides a full-featured native Okta integration.Prerequisites
Before starting development, ensure you have:- Python 3.10 or higher installed
- Access to an Okta developer account
- An Okta API token
- Basic familiarity with Python and async programming
Setting Up the Development Environment
First, create and activate a Python virtual environment:bash
Generating the Facade Connector
Use the Lumos Connector SDK to generate a basic connector structure:bash
auth.py file and passes them to the Integration as credentials. Out of the box you get a single OAuth credential with a validate_credential_config validator, which you then adapt to whatever the target app actually needs — a token, basic auth, or several credentials side by side. See Authorization and Authentication for the full pattern.
If you are working on a connector that only ever takes one credential and you want the
older single-credential shape (auth=OAuthCredential, read with get_oauth(args)), pass
--single-auth to the scaffold tool:
Understanding the Generated Connector Structure
The scaffold command creates several key files:Core Files
__about__.py: Contains version informationmain.py: Entry point for the connectorauth.py: Declares the credentials the connector accepts, and their validatorssettings.py: Defines connector configuration modelintegration.py: Defines connector capabilities and metadataclient.py: Implements API client functionalityconstants.py: Stores shared constants, including the credential ID enum and OAuth URLsenums.py: Defines resource and entitlement types
auth.pyis only generated for multi-auth connectors. With--single-auth, the credential is declared inline inintegration.pyinstead.
Capability Implementation Files
capabilities_read.py: Implements read operationscapabilities_write.py: Implements write operations (not used in this example)
Testing Files
test_all_capabilities.py: Main test runnertest_read_capabilities/test_validate_credential_config_cases.py: Cases for the per-credential validation capability, which the SDK registers automatically for multi-auth connectors- Various test case files for different capabilities
credentials field, and tests/common_mock_data.py defines them tagged with theircredential IDs:
Implementing the Okta Connector
To transform the facade connector into a functional Okta connector, modify several files:1. Settings Model (settings.py)
2. Type Definitions (okta_types.py)
Create this new file to handle Okta-specific types and status mappings:
3. Integration Configuration (integration.py)
Updated to use token authentication and register appropriate capabilities:
4. Client Implementation (client.py)
Implemented the Okta API client with proper authentication and user mapping:
Implementation Details
User Status Mapping
The connector maps Okta user statuses to Lumos account statuses:- ACTIVE → ACTIVE
- SUSPENDED → SUSPENDED
- DEPROVISIONED → DEPROVISIONED
- STAGED → PENDING
- Others → INACTIVE
Pagination
The implementation supports pagination using Okta’s offset-based pagination mechanism, allowing the connector to handle large user sets efficiently.Error Handling
The connector implements proper error handling for API failures and includes type validation to ensure data consistency.Testing the Connector
Execute the test suite to verify the implementation:bash
bash
Deployment
To deploy the connector:Best Practices and Considerations
When implementing your own connector:- Maintain proper type hints and documentation
- Implement comprehensive error handling
- Use appropriate status mapping for your system
- Consider implementing rate limiting for production use
- Add logging for better observability
- Include comprehensive test coverage
- Pin your version of the Connector SDK. This means that in the generated
pyproject.toml, you ensure that references toconnector-pyinclude a specific version. For example:"connector-py == 4.18.0". Check pypi for version history.