I have a problem with the web application that I am creating. The web application consists of the angular 4 framework and the RESTful api mesh core. One of the requirements is that backend requests must be authenticated using mutual SSL authentication; i.e. client certificates.
I currently host both the interface and the backend as Azure application services, and they are on separate subdomains.
The backend is configured to require client certificates, following this guide, which I believe is the only way to do this for Azure application services: https://docs.microsoft.com/en-us/azure/app-service/app- service-web-configure-tls-mutual-auth
When the external interface makes requests to the server, I set withCredentials
to true
- which [according to the documentation] [1] should also work with client certificates.
The XMLHttpRequest.withCredentials property is a boolean property that indicates whether Access Control firewall requests should be executed using credentials such as cookies, authority headers, or TLS client certificates. The setting withCredentials does not affect requests on a single site.
Corresponding code from the interface:
const headers = new Headers({ 'Content-Type': 'application/json' }); const options = new RequestOptions({ headers, withCredentials: true }); let apiEndpoint = environment.secureApiEndpoint + '/api/transactions/stored-transactions/'; return this.authHttp.get(apiEndpoint, JSON.stringify(transactionSearchModel), options) .map((response: Response) => { return response.json(); }) .catch(this.handleErrorObservable);
In Chrome, this works when the request is made, the browser requests a certificate from the user, and it is included in the preliminary verification request, and everything works.
For all other major browsers, however, this is not the case. Firefox, Edge, and Safari do not perform a pre-flight request because the server disconnects if it does not contain a client certificate in the request.
Viewing directly at the api endpoint makes each browser request a certificate from the user, so I’m sure this clearly relates to how most browsers handle pre-validation requests with client certificates.
Something is wrong? Or do other browsers do the wrong thing without requesting a certificate when making requests?
I need to support browsers other than Chrome, so I need to solve this somehow.
I saw that similar problems are solved with the backend, and not for obtaining certificates. The only problem is that I did not find a way to do this using Azure applications. It requires or does not require.
Does anyone have any suggestions on how I can move on?