Skip to content

feat(auth): support Machine Identity JWT login - #62

Draft
Kayvan-Zahiri wants to merge 2 commits into
Infisical:mainfrom
Kayvan-Zahiri:codex/add-machine-identity-jwt-auth
Draft

Kayvan-Zahiri wants to merge 2 commits into
Infisical:mainfrom
Kayvan-Zahiri:codex/add-machine-identity-jwt-auth

Conversation

@Kayvan-Zahiri

Copy link
Copy Markdown

Machine Identities configured with JWT Auth cannot use the Python SDK's authentication helpers: client.auth.jwt_auth is missing, while oidc_auth correctly targets a different endpoint and returns 404 for JWT-only identities.

Add client.auth.jwt_auth.login(identity_id, jwt, organization_slug=None) using the documented /api/v1/auth/jwt-auth/login endpoint, parse the existing MachineIdentityLoginResponse, and set the client token after successful login. Keep OIDC behavior unchanged. Document the public entry point and add the HTTP-interception test dependency.

Fixes #59. API contract: https://infisical.com/docs/api-reference/endpoints/jwt-auth/login

Validation: pytest tests passes all 10 new offline tests. Before: 8 failed (missing jwt_auth), 2 OIDC controls passed. Tests use real Requests serialization through responses, check later-request Authorization headers, optional organization scoping, and 401/403 failures preserving the previous token. Repository-wide CI blocking Flake8 checks pass; new implementation/test files also pass full Flake8 at 99 columns. git diff --check passes.

No live identities, JWTs, credentials, or Infisical resources used. The repository previously had no automated test suite enabled in CI. Bare pytest also discovers existing sink/example scripts that require unavailable local files; only the new offline tests suite was run successfully.

@infisical-cla-app

infisical-cla-app Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

✅ CLA satisfied. All contributors have signed the current CLA. The cla/signed check is passing.

@socket-security

socket-security Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedpypi/​responses@​0.26.399100100100100

View full report

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.

Missing JWT Auth support for Machine Identities (404 on /api/v1/auth/oidc-auth/login)

1 participant