| 1 |
Atlassian |
| 2 |
--------- |
| 3 |
|
| 4 |
Atlassian OAuth 2.0 (3LO) apps provider. |
| 5 |
|
| 6 |
More info: |
| 7 |
https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps/ |
| 8 |
|
| 9 |
|
| 10 |
Enabling OAuth 2.0 (3LO) |
| 11 |
************************ |
| 12 |
Before you can implement OAuth 2.0 (3LO) for your app, you need to enable it for your app using the developer console. |
| 13 |
|
| 14 |
Atlassian developer console |
| 15 |
https://developer.atlassian.com/console/myapps/ |
| 16 |
|
| 17 |
1. From any page on developer.atlassian.com, select your profile icon in the top-right corner, and from the dropdown, select Developer console. |
| 18 |
2. Select your app from the list (or create one if you don't already have one). |
| 19 |
3. Select Authorization in the left menu. |
| 20 |
4. Next to OAuth 2.0 (3LO), select Configure. |
| 21 |
5. Enter the Callback URL. Ex. ``http://127.0.0.1:8000/accounts/atlassian/login/callback/`` |
| 22 |
6. Click Save changes. |
| 23 |
|
| 24 |
Note, if you haven't already added an API to your app, you should do this now: |
| 25 |
|
| 26 |
1. Select Permissions in the left menu. |
| 27 |
2. Next to the API you want to add, select Add. |
| 28 |
|
| 29 |
|
| 30 |
Django setup |
| 31 |
************ |
| 32 |
The app credentials are configured for your Django installation via the admin |
| 33 |
interface. Create a new socialapp through ``/admin/socialaccount/socialapp/``. |
| 34 |
|
| 35 |
Fill in the form as follows: |
| 36 |
|
| 37 |
* Provider, "Atlassian" |
| 38 |
* Name, your pick, suggest "Atlassian" |
| 39 |
* Client id, is called "Client ID" by Atlassian |
| 40 |
* Secret key, is called "Secret" by Atlassian |
| 41 |
* Key, is not needed, leave blank. |
| 42 |
|
| 43 |
Optionally, you can specify the scope to use as follows: |
| 44 |
|
| 45 |
.. code-block:: python |
| 46 |
|
| 47 |
SOCIALACCOUNT_PROVIDERS = { |
| 48 |
'atlassian': { |
| 49 |
'SCOPE': [ |
| 50 |
'read:me', |
| 51 |
'write:jira-work', |
| 52 |
], |
| 53 |
} |
| 54 |
} |
| 55 |
|
| 56 |
.. note:: By default (if you do not specify ``SCOPE``), ``read:me`` scope is requested. |