I have figured out a way (from the KeyCloak side at least) on how to do this.
KeyCloak config
Within Keycloak I have two main tenants to use:
To achieve the desired role structure I am using a combination of client roles and user groups. For each store:
This will produce a JWT that has the role at each store associated with the user.
.NET config
Once the user has logged in through the Keycloak provider:
IClaimsTransformation
that checks if the selected store is passed in as a cookie and if so, gets the users role for that store specifically and maps it to a ClaimType.Role
on the ClaimsIdentity
With regards to the Blazor WASM side, that is something I am trying to work out now.