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

Unable to access grants after using redis operational store #16

Closed sai-nagarjuna-t closed 5 years ago

sai-nagarjuna-t commented 5 years ago

I have configured my clients, resources and identity resources to be in-memory and I have my custom profile service implemented.

services.AddIdentityServer()
.AddInMemoryApiResources(Config.GetAPIResources())
.AddInMemoryClients(Config.GetClients())
.AddInMemoryIdentityResources(Config.GetIdentityResources())
.AddProfileService<ProfileService>()

After adding the IdentityServer4.Contrib.RedisStore for operational data, I am unable to see any of the issued grants in my grants screen

localhost:5000/grants

What I observe is that the GetAllAsync(string subjectId) in PersistedGrantStore.cs is called with a subjectId that is not returning any data from redis.

Please help if I am missing anything to fix this.

AliBazzi commented 5 years ago

Hi @sai-nagarjuna-t The sample code you provided doesn't register Redis as the operational data store by doing something like:

...
.AddOperationalStore(options =>
    {
        options.RedisConnectionString = "---redis store connection string---";
        options.Db = 1;
    })

Are you sure you followed the documentation ?

sai-nagarjuna-t commented 5 years ago

Hi Ali, My bad, I have figured out to solve the prb. Sry for raising an issue. But I have a question in general - is where a way in IDS 4 for the admin to view all the grants issued for all the users.(if it is possible)

AliBazzi commented 5 years ago

Hi @sai-nagarjuna-t This idea is against the secrecy of grants, I don't think there is a way to show that.