IdentityServer4 icon indicating copy to clipboard operation
IdentityServer4 copied to clipboard

Consider API resource user claims to be accessible via user info

Open brockallen opened this issue 9 years ago • 5 comments

IOW, allow user claims to be obtained via user info for an API rather than putting the claims in the AT itself.

This would encourage an API to define their own user claims and associate them with the API scope, but still obtain them dynamically. It will also help discourage APIs from using the user info endpoint for the identity data based on identity scopes that the client is requesting.

brockallen avatar Jul 06 '17 16:07 brockallen

This would seem to make a lot of sense. I'm building a system at the moment that will have multiple services each with an API. Services will be developed and added over time. Each service will define claims that will only make sense to itself, as well as using the generic claims. I'm intending to make my Identity Server act as a repository for other services to store their own claim types, which will be served to them as and when needed.

Doing this via user info would seem to fit that very well.

MatthewGabriel avatar Jul 06 '17 17:07 MatthewGabriel

I have been working on the same idea for that is called an attribute provider using the user info end point.

Here is a description I have written. I will be working on demo code in the coming months. https://wiki.idesg.org/wiki/index.php?title=Identity_Model_Overview#Problem_to_be_Solved

TomCJones avatar Jul 06 '17 18:07 TomCJones

After discussion, reference tokens already solve this. We don't currently update the user claims from the profile service, though, so perhaps that's what this issue should morph into -- a flag on the ApiResuorce, for example, to dynamically fetch the user claims on each call to introspection.

brockallen avatar Aug 01 '17 16:08 brockallen

I also thought about this, and indeed user info endpoint seems the wrong place. It is ment for client, and according to OpenID specification it can be an encrypted token for the specific client itself. So in that case the API will not get far with the answer.

Extending the introspection endpoint with configured claims attributes per scope and/or per resource seems the right approach. Maybe even constructing a JWT ID token to put in the response (optionally signed and encrypted).

jaanclaeys avatar Sep 09 '19 20:09 jaanclaeys

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

lock[bot] avatar Jan 10 '20 09:01 lock[bot]