web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / 'Authorization' header...
Power Apps
Answered

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

(0) ShareShare
ReportReport
Posted on by 156

Hi,

 

I'm currently creating a custom connector and after getting the access token, I need to be able to make a request passing this token in the header as an authentication bearer token, i.e. Authorization: Bearer abcdefghigklmnopqrstuvwxyz0123456789

 

I specified the two required headers on my request, Content-Type and Authorization, but got the following error:

 

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

 

The problem is that this API is located on an on-prem server and "API Key Authentication" is not available when connecting via data gateway.

 

Is there any workaround to this problem?

 

Thank you,

 

Erick

I have the same question (0)
  • Verified answer
    ErickDiaz Profile Picture
    156 on at

    I was able to do figure out a workaround for this problem and it’s now working correctly.

     

    In case someone has the same problem in the future:

     

    1. I created a custom header called "Access-Token" where I pass the value from my Flow as "Bearer abcdefghigklmnopqrstuvwxyz0123456789".


    2. Then, I created a Policy to "Set HTTP header", where the Header Name = Authorization and Header Value = @headers('Access-Token'). The action is set to override and the policy runs on the request.

     

    This will add the header Authorization: Bearer abcdefghigklmnopqrstuvwxyz0123456789 to my request as expected by the API.

  • JacksonOng Profile Picture
    51 on at

    @ErickDiaz ,

     

    You save my day. Thank you for the fantastic solution.

  • brianpmcculloug Profile Picture
    2 on at

    When I try to implement this, I then "Update connector" to save the changes, it doesn't persist and I loose the policy.  Did MS catch on and prevent this from being a workaround?

  • DedalKvint Profile Picture
    9 on at

    Can you please share an example how to create this policy for setting HTTP header?

  • zmansuri Profile Picture
    6,048 Super User 2024 Season 1 on at

    q3.jpgq2.jpgq1.jpg

     

    Hi, I tried your solution. It's not overriding. Can you help?

  • VictorTek Profile Picture
    127 on at

    try changing your Authentication Type to No Authentication under '2. Security' and then try again.

  • Community Power Platform Member Profile Picture
    on at

    You're a real life saver. After hours of work you provided me with the solution I needed. Thank you!

  • croverpfi Profile Picture
    3 on at

    an absolute legend. Thanks very much for this. Saved me a lot of pain

  • jiler Profile Picture
    2 on at

    Running into the same issue, did you end up finding a solution to this?

  • tzalar Profile Picture
    3 on at

    Thank you for this amazing solution! 😄 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard