I’ve setup a HashiCorp Nomad server and I want to add an OIDC authentication method.
I’ve made all preparations on the OIDC provider, added config to Nomad server but I cannot seem to get in ListClaimMappings the roles I need to check
For example I get as JWT response from OIDC provider:
{
//****//,
"resource_access": {
"Nomad": {
"roles": [
"engineering"
]
}
},
//****//,
"groups": [
"nomad_dev"
],
//****//,
}
If I try to add config in Nomad:
{
"OIDCDiscoveryURL": "*****",
"OIDCClientID": "Nomad",
"OIDCClientSecret": "*****",
"OIDCScopes": ["openid", "roles", "email"],
"BoundAudiences": [],
"AllowedRedirectURIs": ["****"],
"ClaimMappings": {},
"ListClaimMappings": {
"groups": "groups"
}
}
I am able to add nomad acl binding-rule create -auth-method=OIDC -bind-type=policy -bind-name=engineering -selector="nomad_dev in list.groups" and login successfully with engineering policy.
But if I want to use the engineering role from resource_access.Nomad.roles and change the ListClaimMappings with a JSON pointer:
"ListClaimMappings": {
"/resource_access/Nomad/roles": "roles"
}
The binding rule nomad acl binding-rule create -auth-method=OIDC -bind-type=policy -bind-name=engineering -selector="engineering in list.roles" doesn’t seem work.
I have tried with "resource_access.Nomad.roles": "roles", "resource_access.*.roles": "roles", nothing seems to work, except the group, that list is not nested.
Am I doing something wrong? From documentations it should work with JSON Pointers, but no examples whatsoever.