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?
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.