I've gone through the examples of Ids4 specifically the client-webapi scenario.
https://github.com/IdentityServer/IdentityServer4/tree/master/samples/Clients
The example mostly illustrate how the client gets the access token, sends the acess token to the WebAPI and the WebAPI doing a check based on policy like scope or claim.
My scenario has the following constraints.
- The access token contains minimal information. Meaning I don't put all of the information which are mostly sensitive in it.
- The WebAPI requires those claims for the policy (not just scope) because the claim will be specific to a user, not the client application.
Example
options.AddPolicy("User", policy =>
{
policy.RequireClaim("ProfileAccess","user:read");
});
options.AddPolicy("Admin", policy =>
{
policy.RequireClaim("ProfileAccess", "user:read", "user:write");
});
In an MVC client, OpenId Connect configuration has an option GetClaimsFromUserInfoEndpoint which calls the UserInfo endpoint using the token and turns those claims into claims for the principal. Is there something similar for WebAPI or do I have to implement it myself? I don't want to include too much information in the access token either.