4

In my client web application, I need to authenticate with the server using ntlm protocol. While using Angular1, with the $http service get request, the browsers (chrome, edge) were doing all the 3 steps of the NTLM authentication by prompting user for username/password.

However, with Angular2, using the http service that comes with Angular2, the browser (chrome,edge) just return 401 and do not do the subsequent steps (they do not even prompt the user for credentials).

How do I make browser do the ntlm authentication for me while using Angular2 ? Please do not suggest the ntlm javascript library. I'm new to StackOverflow. If I haven't given sufficient info or repeated the question, sorry about that.

Thanks in Advance.

1
  • If we've answered your question please mark it appropriately; otherwise let us know if any. Commented Dec 10, 2016 at 13:36

2 Answers 2

5

"withCredentials" needs to set true in headers to make it work. My code is working now.

let options = new RequestOptions({ headers: headers, withCredentials: true });
Sign up to request clarification or add additional context in comments.

Comments

3

I don't believe the problem is with NTLM or in your coding efforts. According to Anton Bessonov, a very reputable SO community member, some modules in Angular2 are just not production-ready yet, while Angular1 is a very stable code release, and my advise is to stick with Angular1 that for the foreseeable future. Ref: angular 1 vs angular 2 for new project

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.