Skip to content

feat: support file path for OKTA_PRIVATE_KEY#35

Open
silvexis wants to merge 1 commit intookta:mainfrom
silvexis:feat/private-key-file-path-support
Open

feat: support file path for OKTA_PRIVATE_KEY#35
silvexis wants to merge 1 commit intookta:mainfrom
silvexis:feat/private-key-file-path-support

Conversation

@silvexis
Copy link
Copy Markdown

@silvexis silvexis commented Apr 8, 2026

Summary

Allow OKTA_PRIVATE_KEY to accept either inline PEM content or a path to a PEM file on disk.

Changes

  • auth_manager.py: In __init__, check if OKTA_PRIVATE_KEY is a valid file path using os.path.isfile(). If so, read the PEM content from disk. Otherwise, fall back to treating the value as inline PEM (with escaped \n handling preserved).
  • .env.example: Added documentation noting that OKTA_PRIVATE_KEY accepts either a file path or inline PEM content.

Behavior

OKTA_PRIVATE_KEY value Behavior
/path/to/key.pem (valid file) Reads PEM content from disk
Inline PEM string with escaped newlines Replaces \n literals with real newlines
Inline PEM string with real newlines Used as-is

Allow OKTA_PRIVATE_KEY to accept either inline PEM content or a path to
a PEM file on disk. If the value is a valid file path, the key is read
from the file; otherwise, it is used as-is (with escaped newline handling
preserved for inline values).
@silvexis silvexis force-pushed the feat/private-key-file-path-support branch from a966cd5 to 6409ce3 Compare April 8, 2026 23:24
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.

1 participant