When a Forge app calls the Assets REST API with 2LO (two-legged OAuth), the request is
authenticated as the app itself rather than on behalf of a logged-in user. In the Forge managed
APIs, this is the asApp() call, as opposed to the asUser() (3LO) call that acts on behalf of
a user.
The app account has no access to Assets data by default. An admin must explicitly grant the app the Assets roles it needs for every operation it performs with 2LO.
Assets uses a layered security model. Even after your app passes API authentication and API authorization, a request must still clear role-based authorization: the requester must hold the Assets roles required to access the target data. See Authorization for the full security model.
For a 2LO app, the "requester" is the app. So granting the right roles to the app is what makes its requests succeed.
Assets roles control what an identity can view or change, and they can be assigned at different scopes. Grant the least-privileged role that still covers your app's operations.
Assets provides a set of roles, such as Users, Developers, and Managers, that grant progressively more access. For the full list of roles and exactly what each one allows, see Roles in Assets.
Map each operation your app performs to the least-privileged role that covers it. For example, an app that reads or edits objects needs the Users role, while an app that changes attributes or object types needs at least the Developers role on the relevant schema or object type.
You add an app to a role the same way you add a user or group, in the Roles tab of a schema or object type, apps can be added alongside users and groups. You must be logged in as an Assets admin with Jira access.
Grant a schema-level role when the app operates across an entire object schema.
This mirrors Add users or groups to an object schema role.
Grant an object type role when the app only needs access to a single object type.
This mirrors Add users or groups to an object type role.
The app can only perform an operation if it has been granted a role that covers it. If your app performs operations across multiple schemas or object types, repeat the steps above for each one. A missing or insufficient role results in an authorization failure for that request, even when the app's OAuth scopes are correct.
Scopes and roles are separate layers and both are required:
Rate this page: