Rate this page:
When using the Product Fetch APIs to make
API requests on the user's behalf via asUser()
, your app needs to have permission from the user.
Your users are prompted to allow access the first time they use your app. The OAuth 2.0 scopes that you declare in the manifest file are displayed to your users on the Authorize app screen.
Each time you change a Forge app's scopes
, you need to upgrade the app as shown below. Each
time scopes
are changed, your users will need to reauthorize the app.
Only scopes that are relevant to the products that the app is installed on to will appear on the authorize app screen. If your app is installed on to another product after being authorized, users will be required to allow access again to include any scopes introduced with the new product.
App scopes must be defined in the manifest file prior to deploying the app. See Permissions for detailed information about each scope.
You can use the forge lint
command to assist you with adding missing scopes in your app.
Navigate to the top-level directory of your app and run the following command:
1 2forge lint
If your app has missing permissions, these will be highlighted individually in the output.
1 2The linter checks the app code for known errors. Warnings are problems you should fix, but that won't stop the app code from building. Press Ctrl+C to cancel. /src/index.jsx 10:57 warning Confluence endpoint: GET /api/content requires "read:confluence-content.summary" scope permission-scope-required 14:56 warning Confluence endpoint: GET /api/content requires "read:confluence-content.summary" scope permission-scope-required 19:51 warning Jira endpoint: GET /rest/api/3/user requires "read:jira-user" scope permission-scope-required ⚠ 3 problems (0 errors, 3 warnings) Run forge lint --fix to automatically fix 0 errors and 3 warnings.
Rerun forge lint
with the --fix
argument to automatically add missing scopes to the
manifest.yml
file.
1 2forge lint --fix
The example below shows all three detected issues were fixed. You can rerun step 1 to continue investigating outstanding errors.
1 2✔ Fixed 0 errors and 3 warnings Run forge lint to review outstanding errors and warnings
Run forge deploy
to deploy the above changes.
You'll need to complete the Upgrade the app section below to apply the changes.
Navigate to the top-level directory of your app and open the manifest.yml
file.
In the permissions section, add or remove scopes
as needed. For example, add
the write:confluence-content scope.
1 2permissions: scopes: - write:confluence-content
Run forge deploy
to deploy the above changes.
You'll need to complete the Upgrade the app section below to apply the changes.
Changes to the app's scopes won't take effect until the app is upgraded.
If you've previously deployed your app, and you change the scopes
in your manifest file,
you also need to redeploy your app before installing it.
Navigate to your app's top-level directory.
If you've changed the scopes
in your manifest file since you last deployed your app, deploy
your app again by running:
1 2forge deploy
Start the upgrade by running:
1 2forge install --upgrade
You’ll see output similar to the following example.
1 2┌───────────────┬──────────────────────────────┬────────────┬─────────────┐ │ Environment │ Site │ Product │ Scopes │ ├───────────────┼──────────────────────────────┼────────────┼─────────────┤ │ ❯ development │ example-dev.atlassian.net │ Jira │ Latest │ │ development │ example-dev.atlassian.net │ Confluence │ Latest │ │ production │ example.atlassian.net │ Confluence │ Out-of-date │ └───────────────┴──────────────────────────────┴────────────┴─────────────┘
Select the Out-of-date
installation to upgrade by using the arrow keys, and then press the enter key
to upgrade the version of the app installed.
Wait for the upgrade successful message to appear.
Make sure that you repeat these steps for each Out-of-date
installation listed for the site that you are upgrading. After completing these steps, your app runs with the updated scopes.
Rate this page: