Example #1
0
        public virtual async Task RemoveAsync(string key)
        {
            var persistedGrant = await PersistentGrantRepository.FindByKeyAsync(key);

            if (persistedGrant == null)
            {
                return;
            }

            await PersistentGrantRepository.DeleteAsync(persistedGrant);
        }
Example #2
0
        public virtual async Task StoreAsync(IdentityServer4.Models.PersistedGrant grant)
        {
            var entity = await PersistentGrantRepository.FindByKeyAsync(grant.Key);

            if (entity == null)
            {
                entity = ObjectMapper.Map <IdentityServer4.Models.PersistedGrant, PersistedGrant>(grant);
                EntityHelper.TrySetId(entity, () => GuidGenerator.Create());
                await PersistentGrantRepository.InsertAsync(entity);
            }
            else
            {
                ObjectMapper.Map(grant, entity);
                await PersistentGrantRepository.UpdateAsync(entity);
            }
        }
Example #3
0
 public virtual async Task RemoveAllAsync(PersistedGrantFilter filter)
 {
     await PersistentGrantRepository.DeleteAsync(filter.SubjectId, filter.SessionId, filter.ClientId, filter.Type);
 }
Example #4
0
        public virtual async Task <IEnumerable <IdentityServer4.Models.PersistedGrant> > GetAllAsync(PersistedGrantFilter filter)
        {
            var persistedGrants = await PersistentGrantRepository.GetListAsync(filter.SubjectId, filter.SessionId, filter.ClientId, filter.Type);

            return(ObjectMapper.Map <List <PersistedGrant>, List <IdentityServer4.Models.PersistedGrant> >(persistedGrants));
        }
Example #5
0
        public virtual async Task <IdentityServer4.Models.PersistedGrant> GetAsync(string key)
        {
            var persistedGrant = await PersistentGrantRepository.FindByKeyAsync(key);

            return(ObjectMapper.Map <PersistedGrant, IdentityServer4.Models.PersistedGrant>(persistedGrant));
        }
Example #6
0
 public virtual async Task RemoveAllAsync(string subjectId, string clientId, string type)
 {
     await PersistentGrantRepository.DeleteAsync(subjectId, clientId, type);
 }
Example #7
0
        public virtual async Task <IEnumerable <IdentityServer4.Models.PersistedGrant> > GetAllAsync(string subjectId)
        {
            var persistedGrants = await PersistentGrantRepository.GetListBySubjectIdAsync(subjectId);

            return(persistedGrants.Select(x => ObjectMapper.Map <PersistedGrant, IdentityServer4.Models.PersistedGrant>(x)));
        }