Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Connector Development
Answered

Possible to Change a Custom Connector's API key at runtime?

(0) ShareShare
ReportReport
Posted on by 9

Hi

 

I have a Power App that needs to fetch data from a 3rd party.  Before I can run most of my queries, I need to first get a token from the API provider by passing in a username and a fixed token.  This gives me back a token, good for fixed amount of time.  Trying to work out how to accomplish this with a canvas app, I've done the following:

 

  • Create a custom  connector that uses no security.  This gives me back a token from the 3rd party API provider
  • Created a second custom connector that uses API key for security

When my canvas app first starts, I'm run my first connector, getting my token back.  Now I need to pass that token to my second connector for additional queries.  I can do this manually when designing the app, but can't ask the user to make same changes.

 

So, is it possible to change the API key used in the second connector at runtime?  If so, how?

 

Tks

 

  • Verified answer
    Radar4 Profile Picture
    9 on at
    Re: Possible to Change a Custom Connector's API key at runtime?

    This is very helpful.  Thanks for that.

  • SameerCh Profile Picture
    on at
    Re: Possible to Change a Custom Connector's API key at runtime?

    You should check out policies (What is policy and where is it used? | Microsoft Learn).

     

    There are 2 ways to send user data to a connector:

    (1) As connection parameters. This is information that is associated with a user's connection. Things like username/password, token, etc.

    (2) As operation parameters. This is data sent when you use a connector's action in an app or a flow.

     

    In your case, since the data is not associated with a connection, you will use operation parameter. So, you can define a custom header and send it to the connector. Your connector can then read the data from the header and use the Set Header Policy to stamp the right Authentication header in the outgoing request.

     

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