public Repository(A2SPAContext dbContext) { DbContext = dbContext; }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, A2SPAContext context, IdentityContext identityContext) { loggerFactory.AddConsole(Configuration.GetSection("Logging")); loggerFactory.AddDebug(); if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); app.UseBrowserLink(); } else { app.UseExceptionHandler("/Home/Error"); } // Add a middleware used to validate access // tokens and protect the API endpoints. app.UseOAuthValidation(); // Alternatively, you can also use the introspection middleware. // Using it is recommended if your resource server is in a // different application/separated from the authorization server. // // app.UseOAuthIntrospection(options => // { // options.AutomaticAuthenticate = true; // options.AutomaticChallenge = true; // options.Authority = "http://localhost:58795/"; // options.Audiences.Add("resource_server"); // options.ClientId = "resource_server"; // options.ClientSecret = "875sqd4s5d748z78z7ds1ff8zz8814ff88ed8ea4z4zzd"; // }); app.UseOpenIddict(); app.UseDefaultFiles(); app.UseStaticFiles(); app.UseStaticFiles(new StaticFileOptions { FileProvider = new PhysicalFileProvider(Path.Combine(env.ContentRootPath, "node_modules")), RequestPath = "/node_modules" }); app.UseMvc(routes => { routes.MapRoute( name: "default", template: "{controller=Home}/{action=Index}/{id?}"); // in case multiple SPAs required. routes.MapSpaFallbackRoute("spa-fallback", new { controller = "home", action = "index" }); }); if (env.IsDevelopment()) { app.UseSwaggerUi(typeof(Startup).GetTypeInfo().Assembly, new SwaggerUiOwinSettings() { OperationProcessors = { new OperationSecurityScopeProcessor("apikey") }, DocumentProcessors = { new SecurityDefinitionAppender("apikey", new SwaggerSecurityScheme { Type = SwaggerSecuritySchemeType.ApiKey, Name = "Authorization", In = SwaggerSecurityApiKeyLocation.Header }) }, DefaultPropertyNameHandling = PropertyNameHandling.CamelCase }); IdentityDbInitializer.Initialize(identityContext); DbInitializer.Initialize(context); } }
public TestUserRepository(A2SPAContext dbContext) : base(dbContext) { }