IdentityServer4 icon indicating copy to clipboard operation
IdentityServer4 copied to clipboard

Is Token.Client needed?

Open cbeall opened this issue 10 years ago • 3 comments

The Token model currently contains a Client property. I'd like to propose that property be exchanged for just a ClientId string (which already partially exists as a read only property which calls the Client property).

Currently, the Client property isn't read anywhere in the codebase except for accessing the ClientId or the AccesssTokenType. The AccessTokenType already exists in the Token model (albeit as a string and not the AccessTokenType enum).

The reason I'd like to see it removed is that it complicates the storage of token. If the client information and tokens are persisted through different means (for example a more typical database for clients and a reliable cache for tokens), it leaves one of three options when retrieving a token.

  1. Make a call to both stores and attach client information to token.
  2. When storing the token, copy all of the client information within the token.
  3. Only include the ClientId string within the token and trust the codebase won't change later by asking for an additional field not being stored.

Any of which are doable, but if there is no need for that for Token to have all of the Client data, its seems preferable to removed Client and replaced with ClientId. I'd be happy to pitch in if that helps the cause.

cbeall avatar Aug 19 '16 11:08 cbeall

that's a good point - we will discuss this for the RC

leastprivilege avatar Aug 20 '16 08:08 leastprivilege

We reworked persistence - it should be a lot easier now. Give it a try. Feel free to open a new issue.

leastprivilege avatar Aug 23 '16 20:08 leastprivilege

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 15 '20 16:01 lock[bot]