public ClientService(
     IMapper mapper,
     IDSContext Context
     )
 {
     this.mapper  = mapper;
     this.Context = Context;
 }
 public AccountController(
     IDSContext context,
     UserManager <User> userManager,
     SignInManager <User> signInManager,
     IIdentityServerInteractionService interaction,
     IAuthenticationSchemeProvider authenticationSchemeProvider,
     IEventService events
     )
 {
     this.context       = context;
     this.userManager   = userManager;
     this.signInManager = signInManager;
     this.interaction   = interaction;
     this.authenticationSchemeProvider = authenticationSchemeProvider;
     this.events = events;
 }
예제 #3
0
        private static async Task InitializeDatabase(IDSContext context, UserManager <User> userManager)
        {
            if (!context.Users.Any())
            {
                foreach (var user in IdsConfig.Users)
                {
                    await userManager.CreateAsync(user, user.PasswordHash);
                }
                await context.SaveChangesAsync();
            }
            if (!context.ApiResources.Any())
            {
                foreach (var res in IdsConfig.ApiResource)
                {
                    await context.ApiResources.AddAsync(res.ToEntity());
                }
                await context.SaveChangesAsync();
            }
            if (!context.Clients.Any())
            {
                foreach (var client in IdsConfig.Clients)
                {
                    await context.Clients.AddAsync(client.ToEntity());
                }
                await context.SaveChangesAsync();
            }

            if (!context.IdentityResources.Any())
            {
                foreach (var resource in IdsConfig.IdentityResources)
                {
                    await context.IdentityResources.AddAsync(resource.ToEntity());
                }
                await context.SaveChangesAsync();
            }

            if (!context.ApiScopes.Any())
            {
                foreach (var resource in IdsConfig.ApiScopes)
                {
                    await context.ApiScopes.AddAsync(resource.ToEntity());
                }
                await context.SaveChangesAsync();
            }
        }
예제 #4
0
 public AuthController(IMemoryCache memoryCache, IDSContext dbContext, ConfigurationValues configuration) : base(memoryCache, dbContext, configuration)
 {
 }
예제 #5
0
 public DeviceManager(IMemoryCache memoryCache, IDSContext eFEntities)
 {
     _memoryCache = memoryCache;
     _idsContext  = eFEntities;
 }
예제 #6
0
 public PacketManager(IDSContext dbContext)
 {
     _dbContext = dbContext;
 }
 public AccountController(IDSContext context)
 {
     this.context = context;
 }
예제 #8
0
 public ResourceOwnerPasswordValidator(IDSContext context)
 {
     _context = context;
 }
예제 #9
0
 public BaseApiController(IMemoryCache memoryCache, IDSContext dbContext, ConfigurationValues configuration)
 {
     Cache         = memoryCache;
     DbContext     = dbContext;
     Configuration = configuration;
 }