Ocelot
Ocelot copied to clipboard
Alternate array syntax to resolve : issue in key names for RouteClaimsRequirement option in configuration
New Feature
Add an alternate syntax to the RouteClaimsRequirement
configuration. Instead of the current shorter (and nicer) current syntax of:
"RouteClaimsRequirement": {
"{ClaimType}": "{ClaimValue}"
}
Support a more verbose array syntax as well:
"RouteClaimsRequirement": [
{
"type": "{ClaimType}",
"value": "{ClaimValue}"
}
]
Motivation for New Feature
Microsoft uses a : to signify hierarchy in configuration files. See https://github.com/dotnet/extensions/issues/782
There is a great workaround on issue 679 that would be unnecessary if an alternate syntax could be used without the : in a key value.
The most common/reported issue is with the default MS role claim type http://schemas.microsoft.com/ws/2008/06/identity/claims/role
Currently this does not work and requires a workaround:
"RouteClaimsRequirement": {
"http://schemas.microsoft.com/ws/2008/06/identity/claims/role": "Administrator"
}
Having an alternate syntax would fix this and "just work":
"RouteClaimsRequirement": [
{
"type": "http://schemas.microsoft.com/ws/2008/06/identity/claims/role",
"value": "Administrator"
}
]
Don't implemented?
I'm having the same problem and was about to suggest the same feature.
@ghorsey Hi Geoff! Will you personally contribute and be responsible for feature delivery?