I am trying to secure the vault UI and command line login using the JWT/OIDC authentication method using Azure AAD as the provider. I am following the documentation but I am ending with the following error message:
Token verification failed. error validating signature: failed to verify signature: failed to verify id token signature
Here are the steps I followed to setup the auth method
- Created an Azure App Registration allowing my redirect URLs
- I have the
Group.Read.All
permissions on the application and delegated type of the Microsoft Graph API - Generated a secret and and its token from the portal
- I am using the v2.0 endpoints
https://login.microsoftonline.com/{my_tenant_id}/v2.0
- I specified the oidc scope to
https://graph.microsoft.com/.default
- I modified the app manifest with
"groupMembershipClaims": "All",
Then I logged in using the token authentication on the vault and issued the following command line.
vault auth enable oidc
vault write auth/oidc/config @azuread-auth-config.json
# Success! Data written to: auth/oidc/config
vault write auth/oidc/role/default @azuread-default-role-config.json
The azuread-auth-config.json
file has the folowing content
{
"oidc_discovery_url": "https://login.microsoftonline.com/{my_tenant_id}/v2.0",
"oidc_client_id": "{my_client_id}",
"oidc_client_secret": "{my_client_secret}",
"default_role": "default"
}
The azuread-default-role-config.json
file has the folowing content
{
"allowed_redirect_uris": [
"http://localhost:8250/oidc/callback",
"https://{my_hostname}/ui/vault/auth/oidc/oidc/callback",
"http://localhost:8200/ui/vault/auth/oidc/oidc/callback"
],
"groups_claim": "groups",
"oidc_scopes": [
"https://graph.microsoft.com/.default"
],
"policies": [
"default"
],
"user_claim": "email",
"bound_audiences": [
"{my_client_id}"
],
"verbose_oidc_logging": "true"
}
The line "verbose_oidc_logging": "true"
has been added only for debugging purpose.
Login process I followed
Once I start the login process on the Vault UI, I get redirected to the url
https://login.microsoftonline.com/{my_tenant_id}/oauth2/v2.0/authorize?client_id={my_client_id}&nonce=5e52640c66c2dsf64f5ds3f1sd46dc6717&redirect_uri=https%3A%2F%2F{my_hostname}%2Fui%2Fvault%2Fauth%2Foidc%2Foidc%2Fcallback&response_type=code&scope=openid+https%3A%2F%2Fgraph.microsoft.com%2F.default&state=744a03304e71ed7e4dedgrd3541544
then I get the sign in successful message which closes the window by itself
I am also tailing the logs on vault server and I can see that a token has been generated. If I go on https://jwt.ms and I paste the JWT token it gets decrypted and I can identify the proper values. I can see about ~90 groups under my user with the proper tenant id and client id.
If I try the login process using the command line vault login -method oidc role=default
I get to the same error message.
Code: 400. Errors:
* Token verification failed. error validating signature: failed to verify signature: failed to verify id token signature