Skip to main content

Notifications

Power Automate - Using Connectors
Answered

Custom Connector - Generic Oauth2 - Google Oauth - Refresh Token

(1) ShareShare
ReportReport
Posted on by 13

Hello, 

I created a custom connector that uses Generic Oauth2 identity type to connect to a Google API.  I am able to create a connection with my Google creds, however I have to fix the connection every hour (that aligns with the access token expiration time).  

Per Google Oauth2 docs, access_type=offline is a required parameter for Google to send a refresh token in the authorize response.  Is there a way to add additional parameters in the custom connector in Power Automate? 

I tried meddling with the auth url (adding &access_type=offline) however that results in a malformed url as list of query params start with a '?' and Power Automate appends '?' to beginning of the first param.  Appending the access_type to clientId and secret results in "invalid creds" errors.  Adding this access_type parameter at the end of scope throws a bad scope error from Google since its not an accepted one. 

Any thoughts on potential options?

  • Verified answer
    srinathsub Profile Picture
    srinathsub 13 on at
    Re: Custom Connector - Generic Oauth2 - Google Oauth - Refresh Token

    Closing the loop here.  I was able to use "Google Identity" security instead.  The only catch is that, if you had accepted the API consent prompt for your account earlier, you have to manually remove it from your google account.  If not, the connection will not re-prompt the consent, thereby not getting a refresh token from Google Auth. 

    It could be more easier/intuitive in power automate, if the connection would re-prompt for an API consent regardless from the user to obtain a refresh token as well upon successful auth.

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,304

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,703

Leaderboard

Featured topics