0

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.

RSBOYLE
  • 55
  • 7

1 Answers1

0

(Unfortunately I am Power Automate newbie. I hope the following helps.)

If I can rephrase your question: you'd like to write a power automate connector that can use the oauth refresh token to create new access tokens as needed. This will enable your power automate connector to continue processing without requiring the user to authenticate with DocuSign every 8 hours.

Yes? If I understand your question correctly, your connector should have a server backend available for managing the authentication. (OAuth authorization code grant should only be used with a server that can protect the application's secret.)

If your connector runs (fully or partly) on a server, then use a different redirect URL that is supplied by your server.

Then, when the user authenticates with DocuSign, the response from DocuSign will be sent to your-app.example.com://oauth_response, your connector will receive it, and your connector can then use the authorization code to obtain both the access token and the refresh token.

If Power Automate calls makes the authentication calls

These stackover flow answers may help too:

Also google for Power Automate custom connector OAuth2

Also ask on Power Automate forums. This is probably the best bet. Your question is really about Power Automate, not DocuSign. DocuSign, for this question, is just another OAuth service provider.

Larry K
  • 47,808
  • 15
  • 87
  • 140
  • Thank you for your answer. As suggested, after much google research, will post question to Power Automate group. I am trying to avoid using custom connectors and use HTTP REST API calls directly in Power Automate. – RSBOYLE Jun 03 '21 at 19:47