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

            if (persistedGrant == null)
            {
                return;
            }

            await PersistentGrantRepository.DeleteAsync(persistedGrant);
        }
Exemplo n.º 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);
            }
        }
Exemplo n.º 3
0
 public virtual async Task RemoveAllAsync(string subjectId, string clientId, string type)
 {
     await PersistentGrantRepository.DeleteAsync(subjectId, clientId, type);
 }
Exemplo n.º 4
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)));
        }
Exemplo n.º 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));
        }