-
-
Notifications
You must be signed in to change notification settings - Fork 916
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
website/integrations: vault: add external group documentation #11994
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -88,8 +88,64 @@ vault write auth/oidc/role/reader \ | |||||
policies="reader" | ||||||
``` | ||||||
|
||||||
## External Groups | ||||||
|
||||||
If you wish to manage group membership in vault via Authentik you have to use [external groups](https://developer.hashicorp.com/vault/tutorials/auth-methods/oidc-auth#create-an-external-vault-group). | ||||||
|
||||||
:::note | ||||||
If you intend to create [external groups](https://developer.hashicorp.com/vault/tutorials/auth-methods/oidc-auth#create-an-external-vault-group) in Vault to manage user access the OIDC role will need to specifically request a custom scope using the `oidc_scopes` option when creating the OIDC role. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does one no longer need to use the |
||||||
This assumes that the steps above have already been completed and tested. | ||||||
::: | ||||||
|
||||||
### Step 1 | ||||||
|
||||||
In authentik, edit the oidc provider created above. Unser "Advanced protocol settings" add "authentik default OAuth Mapping: OpenID 'profile'". This includes the "groups" mapping. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
### Step 2 | ||||||
|
||||||
In hashicorp vault, change the reader role | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
``` | ||||||
vault write auth/oidc/role/reader \ | ||||||
bound_audiences="Client ID" \ | ||||||
allowed_redirect_uris="https://vault.company/ui/vault/auth/oidc/oidc/callback" \ | ||||||
allowed_redirect_uris="https://vault.company/oidc/callback" \ | ||||||
allowed_redirect_uris="http://localhost:8250/oidc/callback" \ | ||||||
user_claim="sub" \ | ||||||
policies="reader" \ | ||||||
groups_claim="groups" \ | ||||||
oidc_scopes=[ "openid profile email" ] | ||||||
``` | ||||||
|
||||||
Add a group | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
``` | ||||||
vault write identity/group/reader \ | ||||||
name="reader" \ | ||||||
policies=["reader"] \ | ||||||
type="external" | ||||||
``` | ||||||
|
||||||
Get the canonical id of the group | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If this is the canonical ID, let's add this full name: |
||||||
|
||||||
``` | ||||||
vault list identity/group/id | ||||||
``` | ||||||
|
||||||
Get the id of the oidc accessor | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
``` | ||||||
vault auth list | ||||||
``` | ||||||
|
||||||
|
||||||
Add a group alias, this maps the group to the oidc backend | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
``` | ||||||
vault write identity/group-alias \ | ||||||
mount_accessor="auth_oidc_xxxxxx" \ | ||||||
canonical_id="group_id" \ | ||||||
name="group name in authentik" | ||||||
``` | ||||||
|
||||||
You should then be able to sign in via OIDC | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you add a period at end of this sentence, please? |
||||||
`vault login -method=oidc role="reader"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.