I need to authenticate the user on the backend using the authentication cookie I have stored. I need to request API in Vue using axios requests and send cookie in those requests. The user should then be authenticated in the backend controller. I store the cookie as a whole:
public string GetOrchardAuthCookie()
{
return new ChunkingCookieManager().GetRequestCookie(_httpContextAccessor.HttpContext, "orchauth_Default");
}
my axios request:
axios.get(apiUrl, {
headers: {
"orchauth_Default": mySavedCookie
}
})
.then(response =>
{
this.categories = response;
})
.catch(this.errorHandle);
after the request is made and I stop the code in the controller, the user has 0 claims
How to make Axios request to authenticate User in asp .net core controller?