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 Automate / Authorization Bearer i...
Power Automate
Answered

Authorization Bearer in Header - Custom Connector

(3) ShareShare
ReportReport
Posted on by

I have created a custom connector that is connecting to a vendor's API.  I have unauthenticated GET methods working, but now am working on some POSTs and am running into an issue with putting "Authorization: Bearer token_value" in the header.  Even on the unauthenticated GET calls, I can see in the request header that "Authorization: Bearer some_token_value" is already there.  I've tried setting the Header in my POST call, but then I get the error: "Message": "Error from ASE: Bad authorization header scheme".

 

I can see that the request header has my token_value and so it appears I'm not allowed to set the header that way.  What is the right way to send my "Authorization: Bearer token_value" to the API?

 

Thank you.

Categories:
I have the same question (0)
  • alexco Profile Picture
    54 on at

    I have the same issue, did you solve it in the meantime?

  • Community Power Platform Member Profile Picture
    on at

    I ended up opening a ticket with Microsoft, went back and forth with them a few times, but they never seemed to understand the issue no matter how many times I explained it, so I've had to give up for now.

  • kmsFG19 Profile Picture
    3 on at

     Facing the same problem - MS should help us out here!! 

  • Verified answer
    Community Power Platform Member Profile Picture
    on at

    I've figured this out by learning about making an OpenAPI document describing the interface, and creating a custom connector off of the document.

    1. On the Security tab, select "API Key" for the Authentication type
    2. For "Parameter Label" put whatever you want someone to see when they are creating a Connection off of this Connector...I used "API Key"
    3. "Parameter Name" should be "Authorization" (no quotes)
    4. For "Parameter Location", select "Header"
    5. When you create a Connection off of this Connector, you'll be prompted for your "API Key" (or whatever you used for step 2 above)
    6. Enter "Bearer YOUR_BEARER_TOKEN_VALUE" (no quotes)

    This will pass your bearer token to the API successfully.

  • alexco Profile Picture
    54 on at

    Nice, I will try this. However, this doesn't work with an expiring token.

  • Community Power Platform Member Profile Picture
    on at

    This did not work for me. Actually nothing has to this point. I've tried encoded Basic authentication with api key and bearer token but still get 401 unauthroized.

  • Community Power Platform Member Profile Picture
    on at

    This works for me as the admin-developer. However when sharing the app with end users, it forces them to enter the API Key to use the application.

     

    Is it known if there is a way to work-around this functionality?

  • keatklein Profile Picture
    14 on at

    The solution provided by rpiwetz worked for me, sort of.  I did need to add an "accept:application/json" header to the defenition first though, otherwise I got a 401 error.

     

    I said "sort of" above because I still cannot figure out a solution for an expiring token.  I can get this to work by population the connector with my expiring token, but then it only works for 1 hour.  Has anybody figured out a solution for an expiring token?

  • DMum Profile Picture
    61 on at

    Same issue expirting token won't work with API Key. Any luck? Thank you!

  • OttoVoss Profile Picture
    6 on at

    I'm facing the same challenge. Have some of you found a way to do it?

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 Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard