Skip to content

Conversation

@kronnk
Copy link

@kronnk kronnk commented Nov 25, 2025

This pull request introduces several minor but important improvements to error handling and data validation in the Okta API client and related models. The main changes include making token retrieval more robust, relaxing validation constraints for the second_email field, and removing an unused parameter in OAuth token generation.

API Client Improvements:

  • Updated the initialization of ApiClient in both okta/api_client.py and the template openapi/templates/api_client.mustache to use .get("token", None) for accessing the token, preventing potential KeyError exceptions if the token is missing from the configuration. [1] [2]

Model Validation Adjustments:

  • Relaxed the minimum length constraint for the second_email field in the UserProfile model, allowing it to be an empty string instead of requiring at least 5 characters.

OAuth Logic Cleanup:

  • Removed the unused client_assertion parameter from the OAuth access token request, likely as part of cleaning up or correcting the OAuth client credentials flow.

Fixes #477 Fixes #473

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

secondEmail field validation is too strict. KeyError: 'token' on client creation using PrivateKey auth in v3.0.0

1 participant