I have developed an automated document process using Power Apps and Power Automate creating custom connectors and HTTP connections to Docusign.
The issue I have is that the custom connector requires refreshing once the user credentials have expired with Docusign (8hrs). This causes the Power Automate flow to fail as the connector has to be manually refreshed and the user is not automatically prompted to renew their login credentials. This results in the application appearing to fail and be unreliable.
I have successfully created a flow that updates my credentials using the refresh token which resolves using the custom connector (HTTP API calls to Docusign) however, I need to obtain refresh tokens for other users and update the refresh token to achieve the same result and avoid having to use custom connectors.
I can manually point a browser session to invoke the user to 'login' to docusign and then, see the authorization code in the browser redirection response.
https://global.consent.azure-apim.net/redirect?code=eyJ0eXAiOiJNVCIsImFsZyI6IlJTMjU2Iiwia2lkIjoiNjgxODVmZjEtNGU1MS00Y2U5LWFmMWMtNjg5ODEyMjAzMzE3In0.AQsAAAABAAYABwAAoKHP_yXZSAgAACwoFwAm2UgCAOid-3Oz8jJHsDvIUG5hRR8VAAEAAAAYAAIAAAAFAAAAHQAAAA0AJAAAAGYwOWNlODQ0LTNlOWMtNDYxMy05MDc3LTRmOTJhYWNjY2U3OCIAJAAAAGYwOWNlODQ0LTNlOWMtNDYxMy05MDc3LTRmOTJhYWNjY2U3ODAAAKChz_8l2UgSAAEAAAALAAAAaW50ZXJhY3RpdmU3AEEOMo4J2G9Jo1RaIjs77bU.EcaJgCJHR2wsW_F0k9NJLbC3Q1F-uNuDm6YRTErVxmo2SCReyGF2KKfYlkWWJhg0bYWI-IO9PQclf5dk89adxGKTUMf_lpoUCibkg_l7yXCYi-tCZiI1gXpENlEFAkvMMH15CJVREfK4KQWvdhIxLaKIrUCMShhEaSP-U2kCoJea9BPpBDV0kmjT2LTiBdVkzCxqwZbqjik4ehpeH1uxWVpStGyUD1sLpXIYrU4uhC5B4yLPmgVZ7SbtGQPf-RCHeIYpOL6XJftrDiZMGHBlXVCwADndk1WhrCSnIs9YGKz1k2nJa1XPT-_bqrzM7wsvXn_QbpJ1ntvFJ6WmdabepQ
I can then apply this authorization code to get the authentication and refresh tokens using Postman.
I am at a loss as to how to intercept the browser session that returns the user authorization code in Power Automate (Http triggers etc.). If I can get the authorization code, I can then obtain the authentication token and refresh tokens in Power Automate.