Andrew Draper
Andrew Draper

Reputation: 179

Power Automate Custom Connector Authorization Header

I am trying to make a custom connector in Power Automate with an API that I have used before with Powershell. The issue is that the one parameter I need in the header is Authorization, which is not allowed by Microsoft for some reason. I have found several forums online about how to get around it, but nothing has worked. Here are some forums with potential solutions:

https://powerusers.microsoft.com/t5/Microsoft-Dataverse/Authorization-header-is-not-allowed-Use-API-Key-authentication/m-p/894511#M10780

https://powerusers.microsoft.com/t5/Connector-Development/Authorization-header-using-HTTP-via-on-premise-datagateway/m-p/1339127

I am running into the same error message when trying to create a header with Authorization in my header:

'Authorization' header is not allowed. Use 'API Key' authentication type in the Security tab to set this header.

Here are my settings. The Authorization parameter should have a string value of "rest_api_key=xxxxxxxxxxx"

enter image description here

enter image description here

enter image description here

Despite me overriding the header, the actual request header in my connection looks like this. The token is a random string that is very long, so I have shortened it for simplicity.

{
  "Authorization": "Bearer eyJ0eXAiOiJKV1...."
}

When I actually go to make a connection I am entering the full value "rest_api_key=xxxxxx" as the Authentication parameter.

Has anybody else run into this issue when trying to set a header of Authorization?

Upvotes: 0

Views: 6684

Answers (2)

John Forma
John Forma

Reputation: 11

I set it to "No authentication" for the authentication type under the security tab. Set a new policy "Set HTTP header", Header name "Authorization", Header value "Basic NzZiZ............" (what you need it to be). Action if header exists, "override". Run policy on "Request".

This worked for me.

Upvotes: 1

Vikas
Vikas

Reputation: 1

In Header Value, just provide the security key of your api.

Upvotes: 0

Related Questions