I got an error when a user with account type is “customer” calls “requestJira” function from “@forge/bridge”. The error message is “Error: An unexpected error occurred when fetching an auth token”.
In my scenario, The user only calls “requestJira(‘/rest/api/3/myself’)” but this request throws error. When I run this request in a new browser window(/rest/api/3/myself), the request is completed successfully.
I expected to see that user with account type is “customer” can call “requestJira” successfully.
I had a look at our logs for your requests and the reason this doesn’t work is because performing requestJira from the bridge is equivalent to performing an asUser request in the Forge function. requestJira & asUser are performing operations as the user (using a 3LO OAuth token under the hood). Unfortunately, this is not supported for unlicensed users.
The reason it may work when you visit the browser window directly is because a session is used as the authentication mechanism when you visit the URL in your browser, this is different to OAuth, which requestJira uses under the hood.