/// <summary> /// Gets all resources. /// </summary> public virtual async Task <IdentityServer4.Models.Resources> GetAllResourcesAsync() { var identityResources = await IdentityResourceRepository.GetListAsync(includeDetails : true); var apiResources = await ApiResourceRepository.GetListAsync(includeDetails : true); var apiScopes = await ApiScopeRepository.GetListAsync(includeDetails : true); return(new Resources( ObjectMapper.Map <List <Volo.Abp.IdentityServer.IdentityResources.IdentityResource>, List <IdentityServer4.Models.IdentityResource> >(identityResources), ObjectMapper.Map <List <Volo.Abp.IdentityServer.ApiResources.ApiResource>, List <IdentityServer4.Models.ApiResource> >(apiResources), ObjectMapper.Map <List <Volo.Abp.IdentityServer.ApiScopes.ApiScope>, List <IdentityServer4.Models.ApiScope> >(apiScopes))); }
/// <summary> /// Gets all resources. /// </summary> public virtual async Task <IdentityServer4.Models.Resources> GetAllResourcesAsync() { return(await ResourcesCache.GetOrAddAsync(AllResourcesKey, async() => { var identityResources = await IdentityResourceRepository.GetListAsync(includeDetails: true); var apiResources = await ApiResourceRepository.GetListAsync(includeDetails: true); var apiScopes = await ApiScopeRepository.GetListAsync(includeDetails: true); return new Resources( ObjectMapper.Map <List <Volo.Abp.IdentityServer.IdentityResources.IdentityResource>, List <IdentityServer4.Models.IdentityResource> >(identityResources), ObjectMapper.Map <List <Volo.Abp.IdentityServer.ApiResources.ApiResource>, List <IdentityServer4.Models.ApiResource> >(apiResources), ObjectMapper.Map <List <Volo.Abp.IdentityServer.ApiScopes.ApiScope>, List <IdentityServer4.Models.ApiScope> >(apiScopes)); }, () => new DistributedCacheEntryOptions { AbsoluteExpirationRelativeToNow = Options.Caching.ClientStoreExpiration })); }