IdentityServer4 how to get ClientProperties into token

entity-framework-core identityserver4 openid-connect

Question

I have an IdentityServer4 with EFCore implementation which is all working nicely. I need to make a change to get some client information included in the token which is proving problematic. I can include the information in the ClientClaims table and it is returned in the token but my understanding is that I should be putting this type of information in the ClientProperties table. When I do that it is not returned in the token and I can't find any information about how to get data from the ClientProperties table into the token.

You're probably going to ask why don't I just use the ClientClaims table but I'm using that table to store which areas of my system the client has access to so would prefer not to use it for cross purposes.

Any help you can give would be appreciated.

1
3
6/18/2018 8:11:32 AM

Accepted Answer

properties

Dictionary to hold any custom client-specific values as needed.

Client properties is just a dictorary where you can use it to store extra information about the client.

Here is an example of what i use it for.

Id  ClientId    Key         Value
265 25          updatedby   21248582
266 25          updateddate 2018-05-30T06:45:10.2389386+00:00

No where is it stated that this information should come as part of the claims.

Your probably going to say "But a i already stated i dont want to use ClientClaims" but this is what ClientClaims is for.

2
6/18/2018 8:10:59 AM

Popular Answer

Client.Properties are used to have data persisted related to that client.

Indeed, the only way to exchange information is thru the claims which is the best practice. You can include custom claim names, just make sure they do not collide with the standard ones.



Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow