Skip to main content
Community site session details

Community site session details

Session Id : bxl6azYpqEItVmJYOy03iX
Power Automate - Connector Development
Unanswered

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

Like (0) ShareShare
ReportReport
Posted on 1 Feb 2022 19:50:03 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
    49 on 25 Jan 2024 at 09:06:28
    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.

  • Community Power Platform Member Profile Picture
    on 14 Apr 2022 at 14:54:04
    Re: Getting access_token when using on-premise data gateway in the custom connector

    Did you ever resolve this? 

  • Dinesh Profile Picture
    62 on 04 Feb 2022 at 14:46:08
    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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1

Featured topics

Loading complete