public static void EnsureSeedData(this SimpleIdServerUmaContext context) { InsertResources(context); InsertPolicies(context); try { context.SaveChanges(); } catch { } }
public static void EnsureSeedData(this SimpleIdServerUmaContext context) { InsertResources(context); try { context.SaveChanges(); } catch { Trace.WriteLine("already exists"); } }
private static void InsertPolicies(SimpleIdServerUmaContext context) { if (!context.Policies.Any()) { context.Policies.AddRange(new[] { new Policy { Id = _firstPolicyId } }); } }
private static void InsertResources(SimpleIdServerUmaContext context) { if (!context.ResourceSets.Any()) { context.ResourceSets.AddRange(new[] { new ResourceSet { Id = "1", Name = "Access to administrator", Scopes = "read,write,execute" } }); } }
private static void InsertResources(SimpleIdServerUmaContext context) { if (!context.ResourceSets.Any()) { context.ResourceSets.AddRange(new[] { new ResourceSet { Id = "bad180b5-4a96-422d-a088-c71a9f7c7afc", Name = "Resources" }, new ResourceSet { Id = "67c50eac-23ef-41f0-899c-dffc03add961", Name = "Apis" } }); } }
private static void InsertPolicyRules(SimpleIdServerUmaContext context) { if (!context.Policies.Any()) { var claims = new List <Core.Models.Claim>(); claims.Add(new Core.Models.Claim { Type = "name", Value = "thabart" }); context.PolicyRules.AddRange(new[] { new PolicyRule { Id = Guid.NewGuid().ToString(), PolicyId = _firstPolicyId, IsResourceOwnerConsentNeeded = false, Scopes = "read,write,execute", Claims = JsonConvert.SerializeObject(claims) } }); } }
private static void InsertPolicies(SimpleIdServerUmaContext context) { if (!context.Policies.Any()) { var claims = new List <Core.Models.Claim>(); claims.Add(new Core.Models.Claim { Type = "sub", Value = "administrator" }); context.Policies.AddRange(new[] { new Policy { Id = _firstPolicyId, PolicyResources = new List <PolicyResource> { new PolicyResource { PolicyId = _firstPolicyId, ResourceSetId = "1" } }, Rules = new List <PolicyRule> { new PolicyRule { Id = Guid.NewGuid().ToString(), PolicyId = _firstPolicyId, IsResourceOwnerConsentNeeded = false, ClientIdsAllowed = "", Scopes = "read,write,execute", Claims = JsonConvert.SerializeObject(claims), OpenIdProvider = "http://localhost:60000/.well-known/openid-configuration" } } } }); } }
public PolicyRepository(SimpleIdServerUmaContext context) { _context = context; }
public SharedLinkRepository(SimpleIdServerUmaContext context) { _context = context; }
public ResourceSetRepository(SimpleIdServerUmaContext context) { _context = context; }
public ScopeRepository(SimpleIdServerUmaContext context) { _context = context; }
public PendingRequestRepository(SimpleIdServerUmaContext context) { _context = context; }
public static void EnsureSeedData(this SimpleIdServerUmaContext context) { InsertResources(context); context.SaveChanges(); }
public TicketRepository(SimpleIdServerUmaContext context) { _context = context; }