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

            if (persistedGrant == null)
            {
                return;
            }

            await PersistentGrantRepository.DeleteAsync(persistedGrant);
        }
コード例 #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);
            }
        }
コード例 #3
0
 public virtual async Task RemoveAllAsync(string subjectId, string clientId, string type)
 {
     await PersistentGrantRepository.DeleteAsync(subjectId, clientId, type);
 }
コード例 #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)));
        }
コード例 #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));
        }