Skip to content

fix(auth): restore get_roles() for Okta — API key creation broken under AUTH_TYPE=OKTA#6254

Merged
shahargl merged 1 commit into
keephq:mainfrom
ahbeigi:fix/okta-get-roles-empty-api-key-creation
Apr 16, 2026
Merged

fix(auth): restore get_roles() for Okta — API key creation broken under AUTH_TYPE=OKTA#6254
shahargl merged 1 commit into
keephq:mainfrom
ahbeigi:fix/okta-get-roles-empty-api-key-creation

Conversation

@ahbeigi
Copy link
Copy Markdown
Contributor

@ahbeigi ahbeigi commented Apr 15, 2026

OktaIdentityManager.get_roles() was overriding the base class with return [] — causing the role dropdown in Settings → API Keys to render "No options" and blocking API key creation entirely under AUTH_TYPE=OKTA.

Predefined roles (admin, noc, webhook, workflowrunner) are defined locally in rbac.py and require no Okta API call, so the base class implementation is correct as-is. Remove the stub override so it falls through to BaseIdentityManager.get_roles().

Also fix DEFAULT_ROLE_NAME in OktaAuthVerifier: "user" is not a valid role in rbac.py and causes a 403 for tokens without an explicit role claim. Change to "noc" (least-privileged predefined role).

Closes #6253

📑 Description

  • Remove get_roles() override in OktaIdentityManager — falls through to BaseIdentityManager.get_roles() which correctly returns predefined roles from rbac.py
  • Fix DEFAULT_ROLE_NAME in OktaAuthVerifier from "user" to "noc"

✅ Checks

  • My pull request adheres to the code style of this project
  • My code requires changes to the documentation
  • I have updated the documentation as required
  • All the tests have passed

ℹ Additional Information

The same stub pattern may be present in other SSO identity managers (KEYCLOAK, AZUREAD, ONELOGIN) — worth a follow-up audit of their get_roles() overrides.

OktaIdentityManager.get_roles() was overriding the base class with
return [] — causing the role dropdown in Settings → API Keys to render
"No options" and blocking API key creation entirely under AUTH_TYPE=OKTA.

Predefined roles (admin, noc, webhook, workflowrunner) are defined
locally in rbac.py and require no Okta API call, so the base class
implementation is correct as-is. Remove the stub override so it
falls through to BaseIdentityManager.get_roles().

Also fix DEFAULT_ROLE_NAME in OktaAuthVerifier: "user" is not a valid
role in rbac.py and causes a 403 for tokens without an explicit role
claim. Change to "noc" (least-privileged predefined role).
@dosubot dosubot Bot added size:XS This PR changes 0-9 lines, ignoring generated files. Bug Something isn't working labels Apr 15, 2026
Copy link
Copy Markdown
Member

@shahargl shahargl left a comment

Choose a reason for hiding this comment

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

lgtm

@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Apr 16, 2026
@shahargl shahargl merged commit 4411945 into keephq:main Apr 16, 2026
9 of 10 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

🌟 Fantastic work @ahbeigi! Your very first PR to keep has been merged! 🎉🥳

You've just taken your first step into open-source, and we couldn't be happier to have you onboard. 🙌
If you're feeling adventurous, why not dive into another issue and keep contributing? The community would love to see more from you! 🚀

For any support, feel free to reach out on the community: https://slack.keephq.dev. Happy coding! 👩‍💻👨‍💻

wsimon1982 pushed a commit to wsimon1982/keep that referenced this pull request May 12, 2026
…er AUTH_TYPE=OKTA (keephq#6254)

Co-authored-by: Ali Hassan-Beigi <ali.hassan-beigi@cloudimperiumgames.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something isn't working lgtm This PR has been approved by a maintainer size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[🐛 Bug]: AUTH_TYPE=OKTA — API key creation broken; role dropdown shows "No options"

3 participants