cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Galbers
Frequent Visitor

Can't get HTTP Action Authentication to work

I am struggling to get Client Certificate authentication to work in flow, I just get the error:

BadRequest. Could not load the certificate private key. Please check the authentication certificate password is correct and try again.

I've checked the password and I'm sure it is correct. Am I missing something in my approach?

 

Capture.PNG

4 REPLIES 4
v-yuazh-msft
Community Support
Community Support

Hi @ Galbers,

 

Please check if you have filled proper value within Pfx field and Password field of "HTTP" action.

 

When you use "HTTP" action with Client Certificate authentication, within Pfx field of "HTTP" action, you should type the Base64-encoded contents representation of your PFX file. Within Password field, type the password to access the PFX file.28.JPG

The parameter format of Client Certificate Authentication as below:

{
    "type": "ClientCertificate",
    "pfx": "aGVsbG8g...d29ybGQ=",
    "password": "xxx..xxx"
}

 

More details about the Client Certificate Authentication, please check the following article:

Client Certificate Authentication

Hi,

 

Thanks for that, however, I did follow the article you mention (or at least I tried!). The one thing that confuses me, having done some research, is that the pfx file by definition is a binary file. So I am unclear as to what a Base64-encoded representation of this file is. That said, here is what I did:

 

openssl genrsa -out privatekey.pem 1024

openssl req -new -x509 -key privatekey.pem -out publickey.cer -days 1825

openssl pkcs12 -export-out public_privatekey.pfx -inkey privatekey.pem -in publickey.cer

 

I then used the contents of the pem file as the Base64-encoded representation of the pfx file generated above. However, I subsequently realised that this was not encoded so I then encrypted the pem file:

 

 openssl rsa -des3 -in privatekey.pem -out encprivatekey.pem

 

However, the result was just the same. I'd really appreciate any tips on where I have gone wrong in the above.

Hi @Galbers 

 

How did you resolved this issue? I am facing the similar issue.

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blogPower Automate Video Tutorials
juresti
Continued Contributor
Continued Contributor

@Galbers  I think you almost have it.

 

Just fix your pfx contens. It should be inside the base64('your get file contents for pfx') formula.

 

It should look like this.

 

04.PNG

 

I uploaded my pfx file to sharepoint and then used a sharepoint Get File Content then put the dynamic content value inside the base64() formula.

 

Also, xero api may need the authorization header key?

 

key: Authorization

Value: Basic [key value] or Bearer [key value]

 

 

 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (1,379)