// 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, SagaBus sagaBus, IOptions<OAuth20Configuration> oauthOptions) { loggerFactory.AddConsole(Configuration.GetSection("Logging")); loggerFactory.AddDebug(); app.UseApplicationInsightsRequestTelemetry(); if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); app.UseBrowserLink(); } else { app.UseExceptionHandler("/Home/Error"); } app.UseApplicationInsightsExceptionTelemetry(); app.UseStaticFiles(); app.UseCookieAuthentication(new CookieAuthenticationOptions { AuthenticationScheme = "Obsidian.Cookie", AutomaticChallenge = false, AutomaticAuthenticate = false }); var oauthConfig = oauthOptions.Value; var key = oauthConfig.TokenSigningKey; var signingKey = new SymmetricSecurityKey(Encoding.Unicode.GetBytes(key)); var param = new TokenValidationParameters { AuthenticationType = "Bearer", ValidateIssuerSigningKey = true, IssuerSigningKey = signingKey, ValidateIssuer = true, ValidIssuer = oauthConfig.TokenIssuer, ValidAudience = oauthConfig.TokenAudience }; app.UseJwtBearerAuthentication(new JwtBearerOptions { TokenValidationParameters = param, AutomaticAuthenticate = false, AutomaticChallenge = false }); app.UseMvc(routes => { routes.MapRoute( name: "default", template: "{controller=Home}/{action=Index}/{id?}"); }); MappingConfig.ConfigureQueryModelMapping(); sagaBus.RegisterSagas(); }
public OAuth20Controller(IDataProtectionProvider dataProtectionProvicer, SagaBus bus, ISignInService signinService) { _dataProtector = dataProtectionProvicer.CreateProtector("Obsidian.OAuth.Context.Key"); _sagaBus = bus; _signinService = signinService; }
// 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, SagaBus sagaBus, IOptions <OAuth20Configuration> oauthOptions) { loggerFactory.AddConsole(Configuration.GetSection("Logging")); loggerFactory.AddDebug(); app.UseApplicationInsightsRequestTelemetry(); if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); app.UseBrowserLink(); } else { app.UseExceptionHandler("/Home/Error"); } app.UseApplicationInsightsExceptionTelemetry(); app.UseStaticFiles(); app.UseCookieAuthentication(new CookieAuthenticationOptions { AuthenticationScheme = AuthenticationSchemes.OAuth20Cookie, AutomaticChallenge = false, AutomaticAuthenticate = false }); app.UseCookieAuthentication(new CookieAuthenticationOptions { AuthenticationScheme = AuthenticationSchemes.PortalCookie, AutomaticChallenge = false, AutomaticAuthenticate = false }); var oauthConfig = oauthOptions.Value; var key = oauthConfig.TokenSigningKey; var signingKey = new SymmetricSecurityKey(Encoding.Unicode.GetBytes(key)); var param = new TokenValidationParameters { AuthenticationType = "Bearer", ValidateIssuerSigningKey = true, IssuerSigningKey = signingKey, ValidateIssuer = true, ValidIssuer = oauthConfig.TokenIssuer, ValidAudience = oauthConfig.TokenAudience }; app.UseJwtBearerAuthentication(new JwtBearerOptions { TokenValidationParameters = param, AutomaticAuthenticate = false, AutomaticChallenge = false }); app.UseMvc(routes => { routes.MapRoute( name: "default", template: "{controller=Home}/{action=Index}/{id?}"); }); MappingConfig.ConfigureQueryModelMapping(); sagaBus.RegisterSagas(); app.UseSwagger(); app.UseSwaggerUi(c => { c.SwaggerEndpoint("/swagger/v1/swagger.json", "Obsidian API"); }); }
public ClientsController(IClientRepository repo, SagaBus bus) { _clientRepository = repo; _sagaBus = bus; }
public UsersController(IUserRepository userRepo, SagaBus bus) { _userRepository = userRepo; _sagaBus = bus; }
public OAuth20Controller(IDataProtectionProvider dataProtectionProvicer, SagaBus bus) { _dataProtector = dataProtectionProvicer.CreateProtector("Obsidian.OAuth.Context.Key"); _sagaBus = bus; }
public ScopesController(IPermissionScopeRepository scopeRepo, SagaBus bus) { _scopeRepository = scopeRepo; _sagaBus = bus; }
public AccountController(SagaBus bus, ISignInService signinService) { _sagaBus = bus; _signinService = signinService; }