Skip to content

Instantly share code, notes, and snippets.

@mclasson
Created August 3, 2017 08:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mclasson/481e7d489249aa33ab6f94d6254a88f6 to your computer and use it in GitHub Desktop.
Save mclasson/481e7d489249aa33ab6f94d6254a88f6 to your computer and use it in GitHub Desktop.
Add Security in AspNetCore part 1
services.AddAuthentication(options =>
{
options.DefaultAuthenticateScheme = CookieAuthenticationDefaults.AuthenticationScheme;
options.DefaultSignInScheme = CookieAuthenticationDefaults.AuthenticationScheme;
options.DefaultChallengeScheme = CookieAuthenticationDefaults.AuthenticationScheme;
})
.AddCookieAuthentication(CookieAuthenticationDefaults.AuthenticationScheme, option =>
{
option.LoginPath = "/home/login";
})
.AddTwitterAuthentication(o =>
{
o.ConsumerKey = Configuration["Authentication:Twitter:ConsumerKey"];
o.ConsumerSecret = Configuration["Authentication:Twitter:ConsumerSecret"];
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment