We are getting windows challenge popups when making service calls from our Angular6 application. Chrome and Firefox seem to be working ok but IE is consistently presenting us with login prompt, and when that occurs the other browsers break and also ask to login.
We believe we have configured our auth interceptor correctly, we've set withCredentials to be true. We also have configured a proxy with our service calls.
Our .net services are hosted on IIS8.5 with Windows authentication and AllowAnonymous enabled.
Let me know if there are additional details I can provide.
Proxy
const Agent = require('agentkeepalive-ntlm');
module.exports = {
'/api': {
target: 'url',
secure: false,
pathRewrite: {"^/api" : ""},
logLevel: "debug",
changeOrigin: false,
agent: new Agent({
}),
onProxyRes: proxyRes => {
//let key = 'application/x-www-form-urlencoded';
let key = 'www-authenticate';
proxyRes.headers[key] = proxyRes.headers[key] &&
proxyRes.headers[key].split(',');
console.log(proxyRes.headers);
}
}
};
Auth Interceptor
export class AuthInterceptor implements HttpInterceptor {
constructor(private router: Router) {}
intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
// Clone the request and set the proper headers
req = req.clone({
headers:
new HttpHeaders (
{
"Accept":"application/json"
}),
withCredentials: true
});
console.log(req);
console.log(next.handle(req))
return next.handle(req);
}