Answer the question
In order to leave comments, you need to log in
How to configure CORS for withCredentials: true?
Hello, I have an api that has sessions.
The problem is that the front does not receive cookies that contain the session key, so the session does not work.
Requests sent with Postman, Swagger - work.
Requests from the front (Angular):
this.http.post('https://webcoin-dev.azurewebsites.net/api/User/signin/'+this.phone, null, { withCredentials: true })
.subscribe(resp => {})
app.UseCors(s =>
{
s.AllowAnyHeader();
s.AllowAnyMethod();
s.AllowCredentials();
s.AllowAnyOrigin();
});
Answer the question
In order to leave comments, you need to log in
Who faced help! Already all Google queries are marked as read.- You have to run on them for two more days. ;)
I googled that if there is "AllowCredentials" you need to specify Origin not "*", but a specific Host, which I did
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question