Search code examples
entity-framework-coreidentityserver4openid-connect

IdentityServer4 how to get ClientProperties into token


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.


Solution

  • 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.