Skip to content

Conversation

@varonix0
Copy link
Member

This PR adds OIDC auth support to the Python SDK

No docs are added, as we are moving docs to on-site documentation.

@varonix0 varonix0 self-assigned this Aug 28, 2025
@varonix0 varonix0 requested a review from akhilmhdh August 28, 2025 15:23
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Greptile Summary

This PR adds OIDC (OpenID Connect) authentication support to the Python SDK, expanding the available authentication methods alongside existing AWS and Universal authentication options. The implementation follows the established architectural pattern used throughout the codebase.

The changes include:

  • New OIDC Authentication Class: Creates infisical_sdk/resources/auth_methods/oidc_auth.py with an OidcAuth class that accepts an identity_id and JWT token, makes a POST request to /api/v1/auth/oidc-auth/login, and sets the access token upon successful authentication
  • Module Integration: Updates auth_methods/__init__.py to export the new OidcAuth class
  • Main Auth Interface: Modifies auth.py to instantiate OidcAuth as self.oidc_auth, making it accessible through the centralized Auth class

The implementation maintains consistency with existing authentication methods by using the same constructor pattern (requests and setToken callback), following identical login method signatures, and integrating seamlessly with the Auth class factory pattern. Users can now authenticate using auth.oidc_auth.login(identity_id, jwt) alongside existing methods like auth.universal_auth.login() and auth.aws_auth.login().

The code structure mirrors the existing auth implementations, ensuring the SDK's API design remains consistent and predictable for developers already familiar with other authentication methods in the SDK.

Confidence score: 4/5

  • This PR is safe to merge with minimal risk as it follows established patterns and adds functionality without breaking existing features
  • Score reflects consistent implementation patterns and straightforward additive changes, though minor formatting improvements could be made
  • Pay attention to the missing newline at end of auth_methods/__init__.py file

Context used:

Context - For event handlers, separate logic for different events (e.g., onClick and onKeyDown) into distinct functions for clarity. (link)

3 files reviewed, 2 comments

Edit Code Review Bot Settings | Greptile

@varonix0 varonix0 requested review from sidwebworks and removed request for akhilmhdh August 28, 2025 15:29
varonix0 and others added 3 commits August 28, 2025 17:30
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Copy link

@sidwebworks sidwebworks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@varonix0 varonix0 merged commit e691bdc into main Aug 28, 2025
9 checks passed
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.

3 participants