I am trying to use a Provider in a Forge app to get authenticate with DocuSign. When I call (in a resolver, this is a UI Kit2 app):
const docusign = api.asUser().withProvider('docusign');
if (!await docusign.hasCredentials()) {
await docusign.requestCredentials();
}
I get:
ERROR 16:50:36.977 0000000000000000a4c692df4d573e47 [NEEDS_AUTHENTICATION_ERR: Authentication required] {
serviceKey: 'docusign',
status: 401
}
And the OAuth flow doesn’t start in the UI. This is likely an error with my Provider definition, but how do I debug this? Is there any way to find out where in the process the 401 is being returned or what calls are being made to the OAuth provider?
Here is the provider definition, and yes, I’ve set the secret with forge providers configure
.
providers:
auth:
- key: docusign
name: DocuSign
scopes:
- signature
type: oauth2
clientId: XXXXXXXXXXXXXXXXXXXXX
remotes:
- docusign-oauth
- docusign-apis
bearerMethod: authorization-header
actions:
authorization:
remote: docusign-oauth
path: /oauth/auth
queryParameters:
response_type: code
exchange:
remote: docusign-oauth
path: /oauth/token
revokeToken:
remote: docusign-oauth
path: /oauth/revoke
retrieveProfile:
remote: docusign-oauth
path: /oauth/userinfo
resolvers:
id: sub
displayName: name
remotes:
- key: docusign-apis
baseUrl: https://demo.docusign.net
- key: docusign-oauth
baseUrl: https://account-d.docusign.com
permissions:
external:
fetch:
backend:
- https://demo.docusign.net
- https://account-d.docusign.com
Thanks!