I'm performing an integration with a Bank api that needs this file to be sent. In postman I configure the certificate and password and I get the connection correctly. However, in my Angular project I am not finding the correct way to send this certificate (.pfx) along with my header.
What is the solution to be able to make this call to the API with the .pfx certificate?
const httpHeaders = {
headers: new HttpHeaders({
'Content-Type': 'application/x-www-form-urlencoded',
})
};
const map = {
'x-api-clientid': config.clienteId,
'grant_type': 'client_credentials'
}
try {
return await this.httpClient.post(config.url_token, map, httpHeaders).toPromise().then((resp: any) => {
console.log('resp')
console.log(resp)
return resp
});
} catch (error) {
console.log('erro in post')
console.log(error);
return false;
}
It is not possible to attach a certificate in the Angular layer. This certificate needs to be attached at a server layer or via an API. In my case, I implemented an API using Azure.