AliBazzi / IdentityServer4.Contrib.RedisStore

A persistence layer using Redis DB for operational data and for caching capability for Identity Server 4
https://www.nuget.org/packages/IdentityServer4.Contrib.RedisStore
MIT License
137 stars 48 forks source link

V4 of the library that supports IdServ4 v. 4 #39

Closed AliBazzi closed 4 years ago

AliBazzi commented 4 years ago

In IdServ4 v4 release, there are two main changes related to the storage facility:

By scanning IdServ4 v4 source code we found a new case for a call that do RemoveAllAsync" for aPersistedGrantFilterbased onsubjectId,ClientIdandSessionId, based on that, I've added a new Redis Set with a key asSubjectId:ClientId:SessionId`.

Note: IdServ4 source code is not inclusive for all the possible cases we may have for PersistedGrantFilter.

Any other possible combination for PersistedGrantFilter other than the already existing, plus the new one mentioned above is going to failback to execute on server side, i.e. the PersistedGrantStore will retrieve the set for SubjectId and filter on the server side based on the predicate value for Retrieval or deletion.

Another change this PR introduce is the extensibility possibility for PersistedGrantStore, most members now are protected instead of private, and all Public methods that implemented IPersistedGrantStore are virtual.

You can test drive the new version by playing around with this version on Nuget.