I have a project where the web is authenticated with an identity and you want me to use JWT for APIs. What changes should I make to use both at the same time?
services.AddAuthentication(options =>
{
options.DefaultAuthenticateScheme = CookieAuthenticationDefaults.AuthenticationScheme;
options.DefaultChallengeScheme = CookieAuthenticationDefaults.AuthenticationScheme;
options.DefaultSignInScheme = CookieAuthenticationDefaults.AuthenticationScheme;
}).AddCookie(options =>
{
options.LoginPath = "/Login";
options.LogoutPath = "/Logout";
options.ExpireTimeSpan = TimeSpan.FromMinutes(43200);
});
Simultaneous use of JWT and Identity
New contributor
YA3H is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.