예제 #1
0
        public async Task <IEnumerable <IdentityServer4.Models.PersistedGrant> > GetAllAsync(PersistedGrantFilter filter)
        {
            var grants = (await _repository.GetListBySubjectIdAsync(filter.SubjectId)).ToList();

            if (grants.Any())
            {
                return(grants.Select(x => new IdentityServer4.Models.PersistedGrant
                {
                    Key = x.Key,
                    Type = x.Type,
                    SubjectId = x.SubjectId,
                    SessionId = x.SessionId,
                    ClientId = x.ClientId,
                    Description = x.Description,
                    CreationTime = x.CreationTime,
                    Expiration = x.Expiration,
                    ConsumedTime = x.ConsumedTime,
                    Data = x.Data
                }));
            }

            return(new List <IdentityServer4.Models.PersistedGrant>());
        }