Closed luiarhs closed 4 years ago
not sure I understand your question, can you reiterate ?
not sure I understand your question, can you reiterate ?
Sure, I want to remove(expire) a key associated with a specified user on a kind of logout/signout event. I explain? That's possible?
you can do that by calling async Task RemoveAllAsync(PersistedGrantFilter filter)
and pass in the filter properties the predicates you want to delete upon.
you can do that by calling
async Task RemoveAllAsync(PersistedGrantFilter filter)
and pass in the filter properties the predicates you want to delete upon.
Can you develop your answer please? Thanks in advance.
Hi @AliBazzi I must update the version of IdentityServer4.Contrib.RedisStore to version 4.0.0 to use the async Task RemoveAllAsync(PersistedGrantFilter filter)
?
If you had an example I'm would be very grateful to you.
Thanks.
You don't have to use V4, if you are on V3, you can still use any of:
Task RemoveAsync(string key);
Task RemoveAllAsync(string subjectId, string clientId);
Task RemoveAllAsync(string subjectId, string clientId, string type);
I don't have example, it's up to you figure out how to consume the store.
after swimming in the IS deep pool that is how we found IS get hashed key:
private const string KeySeparator = ":";
/// <summary>
/// Gets the hashed key.
/// </summary>
/// <param name="value">The value.</param>
/// <returns></returns>
protected virtual string GetHashedKey(string value)
{
return (value + KeySeparator + GrantType).Sha256();
}
and this is how works for me
const string keySeparator = ":";
const string grantType = ""; //grant types: refresh_token, authorization_code
var key = HashExtensions.Sha256(refreshToken + keySeparator + grantType); // IdentityServer4.Models.HashExtensions
await _store.RemoveAsync(key); //PersistedGrantStore
Thank you!
Question Hi, I have one question...
Is there a way to remove(expire) a key associated with each user's in a kind of
signout/logout
event? I'm reading aboutIPersistedGrantStore.cs
but it's not entirely clear to me.Environment