Created
May 3, 2018 19:02
-
-
Save explorer14/31fcaf1fc8a5aa1acc8537775eefd565 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void ConfigureServices(IServiceCollection services) | |
{ | |
services.AddAuthentication(options => | |
{ | |
// these must be set other ASP.NET Core will throw exception that no | |
// default authentication scheme or default challenge scheme is set. | |
options.DefaultAuthenticateScheme = | |
CookieAuthenticationDefaults.AuthenticationScheme; | |
options.DefaultChallengeScheme = | |
CookieAuthenticationDefaults.AuthenticationScheme; | |
}) | |
.AddCookie(); | |
services.AddMvc(options => options.Filters.Add(new | |
RequireHttpsAttribute())); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment