I’m currently using a Forge Webtrigger that makes REST API requests to Jira and Confluence using the standard Forge API calls for example:
api.asUser(userId).requestJira(...)
api.asUser(userId).requestConfluence(...)
I also added permissions like this, and impersonation works perfectly:
permissions:
scopes:
read:jira-work:
allowImpersonation: true
read:task:confluence:
allowImpersonation: true
Now, in my manifest.yml, I also have providers configured for Google and Bitbucket:
providers:
auth:
- key: google
name: Google
scopes:
- "profile"
- "https://www.googleapis.com/auth/userinfo.email"
- "https://www.googleapis.com/auth/calendar.readonly"
...
These providers work fine in other Forge modules.
My question is:
Is there any way to make these Forge providers also available inside a Webtrigger similar to how Jira and Confluence REST APIs are accessible via api.asUser()?
Basically, I’d like to call Google’s API on behalf of the user (using the existing provider authorization) directly from the Webtrigger (with custom auth) context.
Has anyone tried this or found a workaround for using Forge providers within Webtriggers?