I just set up AzureAD authentication via OIDC, with External Groups, and found the docs somewhat confusing/multiple places to look and pieces of information to pull together.
Would it be worth having a central place for that - maybe adding some additional details to the jwt_oidc_providers page?
I also got the AzureAD piece working with UPN, which is more "standard" for us anyway than email, and requires a few additional steps that I'm happy to document if people think it'd be helpful.
cc @jescalan
Please update this, I am working for three days, still I can not figure it out what was the issue is.
@rayterrill Can you please give me some document to configure
yes please
"Finally Azure AD group can be referenced by using the groups objectId as the group alias name for the external group."
is a little confusing and I'm not sure how to proceed from:
https://www.vaultproject.io/docs/auth/jwt_oidc_providers.html#azure-active-directory-aad-
@rayterrill Please feel free to document whatever you found in here even if it's not cohesive or coherent enought to be worthy of updating the Vault official documentation page.
It would surely help others trying to configure it and maybe together we can make something more detailed
Sorry @annerajb lost track of this. Here are the notes I have:
http://localhost:8250/oidc/callback
https://vault.yourdomain.com/ui/vault/auth/oidc/oidc/callback
Group.Read.All
profile (this is necessary to expose the "upn" claim to Vault)
User.Read
vault auth enable oidc
vault write auth/oidc/config oidc_client_id="[CLIENT_ID]" oidc_client_secret="[CLIENT_SECRET]" oidc_discovery_url="https://login.microsoftonline.com/[TENANT_ID]/v2.0" default_role="default"
vault write auth/oidc/role/default user_claim="upn" allowed_redirect_uris="http://localhost:8250/oidc/callback,https://vault.yourdomain.com/ui/vault/auth/oidc/oidc/callback" groups_claim="groups" policies=default oidc_scopes="profile"
vault write identity/group name="admins" type="external" policies="admins"
vault auth list -format=json
vault write identity/group-alias name="GROUP_ID_GUID_FROM_STEP_3" mount_accessor="auth_oidc_VAULT_FROM_STEP_2" canonical_id="ID_FROM_STEP_1"
For any subsequent groups you want to map through from AzureAD, you just need to repeat the steps in the "Vault - Mapping "External" AzureAD Groups to the OIDC Provider" section - create an External Group in Vault for the group, then map the AzureAD group to the Vault group using the identity/group-alias functionality.
@rayterrill
FYI
Step 4.
Under Token configuration (currently in preview as of 1/2020), click "Add groups claim", check the box for "All groups", and click SAVE. This passes group info to Vault, which allows us to map AzureAD groups into Vault groups to apply different permissions.
So without setting --optional-claims for the application, as per Vault's OIDC Provider Configuration guide, you can set either
"groupMembershipClaims": "All",
or
"groupMembershipClaims": "SecurityGroup",
With az command, above can be set with
export AZUREAD_APP_DISPLAY_NAME="vault-app"
az ad app update \
--id "$(az ad app list --query "[].{appId:appId,displayName:displayName}[?displayName=='${AZUREAD_APP_DISPLAY_NAME}']" | jq -r '.[] | .appId')" \
--set groupMembershipClaims=All