Our website needs to authenticate against a third party webservice and create a cookie. We don't need to store the membership information. I have the following code in Startup.cs
app.UseCookieAuthentication(options => {
options.AuthenticationScheme = CookieAuthenticationDefaults.AuthenticationScheme;
options.LoginPath = new PathString("/User/Login");
options.CookieName = "GEMSNCID";
options.ExpireTimeSpan = new System.TimeSpan(1, 0, 0);
});
and the login method is
var claims = new[]
{
new Claim(ClaimTypes.Name, model.UserName),
new Claim(ClaimTypes.Country, "USA")
};
var identity = new ClaimsIdentity(claims, CookieAuthenticationDefaults.AuthenticationScheme);
ClaimsPrincipal principal = new ClaimsPrincipal(identity);
Context.Response.SignIn(CookieAuthenticationDefaults.AuthenticationScheme, principal);
return RedirectToAction("Index", "Home");
This is not working. Can someone please help.