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 / Getting access_token w...
Power Automate
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:
I have the same question (0)
  • Shidin Haridas Profile Picture
    49 on at

    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.

  • Community Power Platform Member Profile Picture
    on at

    Did you ever resolve this? 

  • Dinesh Profile Picture
    62 on at

     

    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

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
David_MA Profile Picture

David_MA 245 Super User 2025 Season 2

#2
Expiscornovus Profile Picture

Expiscornovus 207 Most Valuable Professional

#3
trice602 Profile Picture

trice602 185 Super User 2025 Season 2

Last 30 days Overall leaderboard