J'ai enfin obtenu ma méthode de connexion avec JWT Token Authentication.SignInAsync vs AuthenticateAsync
Ici, je vous appelle
await HttpContext.SignInAsync(
CookieAuthenticationDefaults.AuthenticationScheme,
ClaimsPrincipalFactory.CreatePrincipal(claims),
authProps);
J'ai aussi appelé
await HttpContext.AuthenticateAsync(CookieAuthenticationDefaults.AuthenticationScheme);
Dans l'exemple que je lis que je ne le besoin SignInAsync
. J'ai donc testé et retiré AuthenticateAsync
Mais encore, User.Identity.IsAuthenticated
renvoie true
.
Est-il correct d'enlever le AuthenticateAsync
? Ou est-ce que j'en ai encore besoin? Pourquoi existe-t-il? La chaîne doc de AuthenticateAsync
dit que méthode d'extension pour Authentifier