hashicorp / hashicorp/vault-plugin-auth-jwt
allow non-string values (and arrays) in claim_mappings
- Dominant language
- Go
- Stars
- 107
- Forks
- 73
- Avg merge
- 13h 49m
- Merged PRs (30d)
- 7
Description
I was asked to raise an issue here following a conversation in google groups.
I'm using 1.4, and have Azure OIDC authentication working. However, I cannot have any claim that is a non-string
so, for example , part of the returned jwt from azure has this
iat": 1587560836,
"nbf": 1587560836,
"exp": 1587564736,
"acct": 0,
"auth_time": 1587541385,
"email": "julian@nodeable.io",
and I wanted to store "exp" as part of the entity alias metadata . if I include {"exp":"exp"} as part of the claims_mapping, the authentication fails with
"error converting claim 'exp' to string"
IOW, any non-string claim can't be assigned in the claims_mapping option
The other problem as I mentioned was that I wanted to get the azure user groups of the user into the entity alias. Azure returns the groups as
groups: ["group1","group2"]
and again, if I try to put a {groups:groups} claim in the claims_mapping vault borks with a
"error converting claim 'groups' to string"
is there any template magic than can be applied to the claims_mapping or is it a limitation of vault ?
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by tracing how claim_mappings handles the numeric exp claim and the groups array, using the reported "error converting claim ... to string" failures as the entry point. Determine the expected representation for non-string values and arrays, then verify that both types can be mapped into entity alias metadata without breaking existing string mappings.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- authentication
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100