I am working on localhost where angular and web api using 2 different ports that's causing issue now.
I am trying to call web api c# from angular like this
this.http.post<AccessToken>(`${this.url}/api/Home/Eid/?code=12345sfffs`,{headers:this.httpHeaders}) .pipe(Response => { console.log("hi"); console.log(Response); return Response; }); ```
But I am getting below error
Failed to load resource: the server responded with a status of 401 (Unauthorized)
When I tried in postman also I got same 401 error and later I fixed by adding NTLM credentials in postman to get 200 response.
But how to pass NTLM credentials from angular post call? And why web api expecting for NTLM credentials?
Thanks in advance!
I have modified my angular post call to this
In Web API, I have modified web.config to this