Can offer some insight on what this should look like? Does the header in the definition need to have something? I found this solution but it does not work for me.
@RamyEdrees Can you provide the screenshots of your method too so I can better understand your version and compare with @gabeng
I will try @gabeng's method first but I wanted to try your method too and rather than waste hours trying to guess at how you solved it above, thought screenshots would help. Thanks
Authentication can be implemented in many different ways in APIs. Do you have information about what is required in your case? Is your API maybe public on PostMan (or can you make it public)?
In my case the issue was not the generation of the Bearer Token, but its use in all subsequent API calls in a specific header parameter.
Hello i am currently facing the same issue is it possible to share some screenshots how you have done it?
BR
Hi @gabeng ,
First of all thank you so much for you prompt help and reply. I really appreciate it.
I managed to solve my problem last night. I have used a different approach. I used Power automate to get the Bearer Token and then created another header in the API call and placed the bearer token there.. and finally got response 🙂
Thank you again for your help and time..
Have a wonderful day
Hi @RamyEdrees,
to be clear: this is a dirty workaround because the (secret) API key must be provided as input to an action. One could improve this using Azure key vault, but I have not done that yet.
Here a few screenshots:
Authentication type remains empty:
I implemented the function to generate the token manually:
I specified two policies. One policy rewrites the "Origin" header (required by the external API I intend to use). In my case this policy must be applied also when generating the token:
The second policy rewrites the "Authorization" header for every subsequent call after the token generation:
Depending on the requirements of the external API that you intend to use, these policies may have to look different.
An example flow would look like this:
HTH.
Hi @gabeng,
It seems that you were facing the same problem that I currently have. Do you mind sharing screenshot of all the steps in order to guide me in this? I am not a developer.. I am doing this for my family business
I have the same issue with APIs that work with Bearer tokens. This post provided the answer for me:
While you cannot set a request parameter with the name "Authorization" you may put the Bearer Token into a different header parameter and then use a Policy to rewrite this parameter into a parameter "Authorization". Now I am using a single Custom Conntector to
This is an additional list of http parameters that you would have to treat this way:
https://learn.microsoft.com/en-us/azure/connectors/connectors-native-http#omitted-http-headers
Unfortunately, the policies do not seem to be part of the json when exporting a Custom Connector.
How can we dynamically pass the accesstoken to the connection in a POwer automate flow? I am fetching the token using a HTTP call and saving in a variable in my flow. How can i pass this parameter to the custom connector API Key parameter?
CG-07052056-0
20
stampcoin
6
CU17051452-1
2