Skip to main content

Notifications

Power Automate - Connector Development
Unanswered

Getting access_token when using on-premise data gateway in the custom connector

(0) ShareShare
ReportReport
Posted on by 49
How can we pass the current logged in power apps user's access_token to a custom connector?
Custom connector connects to internally hosted APIs via the data gateway.

Context:
Client has a canvas app which does CRUD operations with an external system, facilitated by usage of a custom connector and APIs.
All the APIs are internal (not exposed via the internet). So the custom connector connects via on-prem data gateway.
Shidin_0-1643744878505.jpeg

 

 
The limitation of enabling that check-box is that we seem to be limited in our Authentication types to the below 3 options.
Shidin_1-1643744878513.jpeg

 

 
The APIs we are consuming are role-based. So they need to know + validate who the calling user is (via the JWT access_token). That's the use case.
 
Trying to see if any of the following scenarios work:
  1. Get the user's access_token from the Power App and then pass it to the API as a HTTP header.
    (Might be able to pull it off using a Power Automate flow)
  2. If #1 is not possible, then make the APIs public and with OAuth 2.0 auth, which will solve the problem. But if the APIs are made public, we need to go through security reviews and pen tests, which I am trying to avoid.
Thanks in advance!
Categories:
  • Shidin Haridas Profile Picture
    Shidin Haridas 49 on at
    Re: Getting access_token when using on-premise data gateway in the custom connector

    No supported wat to do this, as confirmed by Microsoft product team.

    We could manipulate the YAML to include OAuth while connecting to on-premise was offered as a workaround, but its an undocumented approach.

  • Re: Getting access_token when using on-premise data gateway in the custom connector

    Did you ever resolve this? 

  • Dinesh Profile Picture
    Dinesh 62 on at
    Re: Getting access_token when using on-premise data gateway in the custom connector

     

    I am not sure about getting the user's token from canvas app. But you can try to simulate the steps of Oauth flow using HTTP connector without creating custom connector.

     

    1. Generate an access token depending on the API setup with HTTP call

    2. Using the new token in the header for the actual API calls

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,666

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,996

Leaderboard

Featured topics