Nomad OIDC Auth method name format error


Thanks for adding Name formatting to OIDC auth method.

But I am not able to get it working beyond the default.

This works -

But this does not -

As per this PR - Allow setting a token name template on auth methods by jorgemarey · Pull Request #19135 · hashicorp/nomad · GitHub the second format should work too.

I looked at the code here too. It should interpolate the format -

But I see the following error -
Error performing login: Unexpected response code: 500 (rpc error: failed to generate ACL token name: 1:43: unknown variable accessed: value.user) Nomad Auth Error: #<JSON::ParserError: unexpected token at ''> Variable not found

Any guidance please. The documentation doesn’t have much to go on.

PS: we are using Okta as the OIDC provider.


Do you have “ClaimMappings” for the Nomad OIDC auth method? The user value should be configured based on those mappings.

thanks @abpetrov

Adding this to the claimMappings fixed the issue.

"ClaimMappings": {
    "name": "name"

based on the you claimMapping, the format should be like this: