Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow for role name to be used as entity alias #226

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

mbillow
Copy link

@mbillow mbillow commented Mar 26, 2023

Overview

Allows for the name of the role being used during authentication to be provided as the name of the entity alias. This allows for JWTs with many distinct, disparate claims to effectively be mapped to a single identity. Examples and more explanation can be found in #217.

Closes #217.

If this is something y'all would be willing to accept, I can make the documentation PR. 😄

Design of Change

Adds a boolean to roles on the JWT auth backend (role_name_as_entity_alias) which is checked at login and if true causes the name of the role being used to be provided as the entity alias name. This defaults to false.

Related Issues/Pull Requests

Testing Output

=== RUN   TestLogin_RoleNameAsEntityAlias
2023-03-26T14:00:29.546-0500 [WARN]  unable to locate /org/primary in claims: /org/primary at part 0: couldn't find key "org"
--- PASS: TestLogin_RoleNameAsEntityAlias (0.00s)
PASS

Contributor Checklist

  • Add relevant docs to upstream Vault repository, or sufficient reasoning why docs won’t be added yet
  • Add output for any tests not ran in CI to the PR description (eg, acceptance tests)
  • Backwards compatible

@verdel
Copy link

verdel commented Aug 10, 2024

@fairclothjm, could you help review this PR? What needs to be done? Using the role name as an entity-alias will make the process of adding a Vault JWT role to an internal group more customizable. The role can essentially be added to the group based on bound_claims rather than user_claim. This approach allows for more precise matching by using multiple claims instead of just one.

This is described in more detail in the issue.

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.

[req] Ability to use JWT Role Name as Identity entity alias name
2 participants