Only one grant exists per app for a given Atlassian account. If a user grants access to more than one Atlassian site for this app, then the additional sites are added to the same grant. This means that existing access tokens will give you access to all sites and scopes that a user has granted your app access to.
The primary use for the state parameter is to associate a user with an authorization flow. This makes the authorization flow more secure, as the authorization flow cannot be hijacked to associate a user's account with another user's token. Consider the following example scenario using Jira:
state
parameter.client_id
.code
parameter.If the Incidents_Application integration had used a state
parameter, the Incidents_Application
would have known that the callback URL belonged to Mallory and ignored the request.
Other uses for the state
parameter include:
The User Identity API is used to retrieve the public profile of the authenticated user. If you want to use this API, do the following:
read:me
scope to the authorization URL for your app.An example of a request to retrieve the public profile of the authenticated user is shown below:
1 2curl --request GET \ --url https://api.atlassian.com/me \ --header 'Authorization: Bearer ACCESS_TOKEN' \ --header 'Accept: application/json'
Example response:
1 2{ "account_type": "atlassian", "account_id": "112233aa-bb11-cc22-33dd-445566abcabc", "email": "mia@example.com", "name": "Mia Krystof", "picture": "https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/112233aa-bb11-cc22-33dd-445566abcabc/1234abcd-9876-54aa-33aa-1234dfsade9487ds", "account_status": "active", "nickname": "mkrystof", "zoneinfo": "Australia/Sydney", "locale": "en-US", "extended_profile": { "job_title": "Designer", "organization": "mia@example.com", "department": "Design team", "location": "Sydney" } }
CORS whitelisting is supported for api.atlassian.com
. CORS whitelisting allows OAuth 2.0 authorization
code grants to work for browser-based XHR or fetch requests subject to cross-origin restrictions, such
as Chrome or Electron apps.
Rate this page: