cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
ewermix
Level: Powered On

Using a static basic autherization key

Hi,

 

When I try to set a basic authentication ( user/pass), or api key (via Authorization) - when Gateway try to reach the API, it changes the parameters to Bearer instead to keep in Basic. Anyone has any idea hwo to force to run Basic instead of Bearer ?

 

Thanks,

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Using a static basic autherization key

Hi @ewermix ,

Could you please share a bit more about your Rest API you used within your custom connector?

Does your Rest API support Basic Authentication (Username + Password)?

 

Based on the issue that you mentioned, I think you have some misunderstanding on the authentication in custom connector of PowerApps.

 

Actually, your custom connector use Access_Token to access your Rest API/ call corresponding server instead of the actual Username & Password , or API Key.

When you create a connection to your custom connector within the "Test" step along with your Username & Pasweord, or API Key, it would send an HTTP Reuqest along with your Username & Pasweord, or API Key to your Rest API/corresponding server, your Rest API/corresponding server would authenticate the credentials you passed, if pass, the corresponding server would return a Access_Token to you, and save it within the created connection.

When you test the actions you specified in your custom conector, the connection would call the corresponding server along with the stored Access_Token.

Within PowerApps, regardless of which authentication way (OAuth2.0, Basic Auth, API Key) you used within the custom connector, when you create a connection to the custom connector, the corresponding server would return a Access_Token to you if the credentials you provided is correct. When you call the action you specified in your custom connector later, it would send an HTTP request to the corresponding server along with the stored Access_Token rather than the actual Username & Password , or API Key.

 

Based on the error message within the screenshot you provided, it seems to tell that there is something wrong with the connection you created to your custom conector. Please check if you have used a proper Username and Password to create a connection to your custom conector.

Also please consider specify the API Key as authentication way in your custom connector, and configure it as below:2.JPG

Set Parameter location property to Header.

 

Please take a try with above solution, then check if the issue is solved.

 

In additon, there is no way to force the custom connector to use Basic credential (Username & Password) rather than Bearer (Access_Token) in PowerApps currently.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
4 REPLIES 4
Super User
Super User

Re: Using a static basic autherization key

Hi @ewermix 

 

You can setup Basic authentication by creating a custom connector. This can be done by doing following steps:
1) Login to PowerApps.
2) Navigate to Custom Connector inside Data.
3) Provide the details about your API.
4) On the security tab, you can set the Authentication as basic, and choose to pass username and password as query parameters.
 
Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
ewermix
Level: Powered On

Re: Using a static basic autherization key

Hi @yashag2255 ,

 

Its already configured to use basic authentication.. however the request keeping using Bearer Smiley Sad

 

Follow below: 

 

Screen Shot 2019-06-13 at 13.49.43.pngScreen Shot 2019-06-13 at 13.50.20.png

Community Support Team
Community Support Team

Re: Using a static basic autherization key

Hi @ewermix ,

Could you please share a bit more about your Rest API you used within your custom connector?

Does your Rest API support Basic Authentication (Username + Password)?

 

Based on the issue that you mentioned, I think you have some misunderstanding on the authentication in custom connector of PowerApps.

 

Actually, your custom connector use Access_Token to access your Rest API/ call corresponding server instead of the actual Username & Password , or API Key.

When you create a connection to your custom connector within the "Test" step along with your Username & Pasweord, or API Key, it would send an HTTP Reuqest along with your Username & Pasweord, or API Key to your Rest API/corresponding server, your Rest API/corresponding server would authenticate the credentials you passed, if pass, the corresponding server would return a Access_Token to you, and save it within the created connection.

When you test the actions you specified in your custom conector, the connection would call the corresponding server along with the stored Access_Token.

Within PowerApps, regardless of which authentication way (OAuth2.0, Basic Auth, API Key) you used within the custom connector, when you create a connection to the custom connector, the corresponding server would return a Access_Token to you if the credentials you provided is correct. When you call the action you specified in your custom connector later, it would send an HTTP request to the corresponding server along with the stored Access_Token rather than the actual Username & Password , or API Key.

 

Based on the error message within the screenshot you provided, it seems to tell that there is something wrong with the connection you created to your custom conector. Please check if you have used a proper Username and Password to create a connection to your custom conector.

Also please consider specify the API Key as authentication way in your custom connector, and configure it as below:2.JPG

Set Parameter location property to Header.

 

Please take a try with above solution, then check if the issue is solved.

 

In additon, there is no way to force the custom connector to use Basic credential (Username & Password) rather than Bearer (Access_Token) in PowerApps currently.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
ewermix
Level: Powered On

Re: Using a static basic autherization key

Hi @v-xida-msft ,I have re-created the whole connector and worked like a charm ! Thanks for clarifying Smiley Wink