main
Paul Schneider 10 years ago
parent e85b41313f
commit 529f92676a
1 changed files with 10 additions and 8 deletions

@ -31,15 +31,15 @@ namespace testOauthClient
// This method gets called by the runtime. Use this method to add services to the container. // This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services) public void ConfigureServices(IServiceCollection services)
{ {
/* services.Configure<SharedAuthenticationOptions>(options =>
{ services.Configure<SharedAuthenticationOptions>(options => {
options.SignInScheme = "ClientCookie";
}); */
services.AddAuthentication(options => {
options.SignInScheme = "ClientCookie"; options.SignInScheme = "ClientCookie";
}); });
// Add framework services.
services.AddAuthentication();
services.AddMvc(); services.AddMvc();
} }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
@ -56,7 +56,10 @@ namespace testOauthClient
{ {
app.UseExceptionHandler("/Home/Error"); app.UseExceptionHandler("/Home/Error");
} }
app.UseIISPlatformHandler(options => {
options.AuthenticationDescriptions.Clear();
});
app.UseStaticFiles();
app.UseCookieAuthentication(new CookieAuthenticationOptions { app.UseCookieAuthentication(new CookieAuthenticationOptions {
AutomaticAuthenticate = true, AutomaticAuthenticate = true,
AutomaticChallenge = true, AutomaticChallenge = true,
@ -85,7 +88,6 @@ namespace testOauthClient
Authority = "http://dev.pschneider.fr/" Authority = "http://dev.pschneider.fr/"
}); });
app.UseStaticFiles();
app.UseMvc(routes => app.UseMvc(routes =>
{ {

Loading…