Creating a web administration panel has been my goal, and I've written a backend controller to assist in delivering the necessary data. However, due to sensitive information, I decided to implement HTTP Digest authentication. When accessing the site via a browser, users can enter their username and password into the browser-generated login screen (standard browser auth box). If the credentials are correct, the data is displayed in JSON format as it functions as a RESTful API.
I have attempted to implement this feature in Angular for days without success. While I came across blog posts with instructions, they only covered HTTP Basic authentication, which is not what I'm looking for.
Trying to retrieve the realm/nonce and other details by sending a GET request to the specified URL has proven unsuccessful. Every attempt results in receiving the "WWW-Authenticate" header along with an error message (401 unauthorized), making it impossible to read the required information for further steps involving md5(username:realm:password) encryption. Reading the WWW-Authenticate header or utilizing X-headername has also proven challenging.
sendCredentials()
{
console.log("Send cred");
this.http.get(this.targetUrl, {observe: 'response'}).subscribe(res => {
console.log(res.headers.get('WWW-Authenticate'));
})
//Normally i want to set the nonce here and then i
//want to generate my md5 Value to send this in the next step with a new http get request)
}
In search of a solution to this issue, Google hasn't been much help to me. Any assistance would be greatly appreciated!