private bool CheckApiScopeAndApiScopeData(ApiScopeData data, IdentityApiScope apiScope) { return (data != null && apiScope != null && data.Name == apiScope.Name && data.DisplayName == apiScope.DisplayName && data.Description == apiScope.Description && data.Enabled == apiScope.Enabled); }
private static void SeedApiScopeClaims(IAdminStore <Entity.ApiScopeClaim> apiScopeClaimStore, IdentityServer4.Models.ApiScope resource) { foreach (var claim in resource.UserClaims) { apiScopeClaimStore.CreateAsync(new Entity.ApiScopeClaim { ApiScopeId = resource.Name, Id = Guid.NewGuid().ToString(), Type = claim }).GetAwaiter().GetResult(); } }
private static void SeedApiScopeProperties(IAdminStore <Entity.ApiScopeProperty> apiScopePropertyStore, IdentityServer4.Models.ApiScope resource) { foreach (var property in resource.Properties) { apiScopePropertyStore.CreateAsync(new Entity.ApiScopeProperty { ApiScopeId = resource.Name, Id = Guid.NewGuid().ToString(), Key = property.Key, Value = property.Value }).GetAwaiter().GetResult(); } }
public void UpdateApiScope(ApiScope obj) => Update(obj.ToEntity());
public void RemoveApiScope(ApiScope obj) => Remove(obj.ToEntity());
public void AddApiScope(ApiScope obj) => Add(obj.ToEntity());
/// <summary> /// Maps a model to an entity. /// </summary> /// <param name="model">The model.</param> /// <returns></returns> public static Scope ToEntity(this IdentityServer4.Models.ApiScope model) { return(model == null ? null : Mapper.Map <Scope>(model)); }