PageRenderTime 25ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/doc/administration/auth/atlassian.md

https://gitlab.com/klml/gitlab-ee
Markdown | 86 lines | 57 code | 29 blank | 0 comment | 0 complexity | 9814b26a0ef431668c6d8b01be4a8266 MD5 | raw file
  1. ---
  2. type: reference
  3. stage: Manage
  4. group: Access
  5. info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
  6. ---
  7. # Atlassian OmniAuth Provider **(FREE SELF)**
  8. To enable the Atlassian OmniAuth provider for passwordless authentication you must register an application with Atlassian.
  9. ## Atlassian application registration
  10. 1. Go to <https://developer.atlassian.com/apps/> and sign-in with the Atlassian
  11. account that will administer the application.
  12. 1. Click **Create a new app**.
  13. 1. Choose an App Name, such as 'GitLab', and click **Create**.
  14. 1. Note the `Client ID` and `Secret` for the [GitLab configuration](#gitlab-configuration) steps.
  15. 1. In the left sidebar under **APIS AND FEATURES**, click **OAuth 2.0 (3LO)**.
  16. 1. Enter the GitLab callback URL using the format `https://gitlab.example.com/users/auth/atlassian_oauth2/callback` and click **Save changes**.
  17. 1. Click **+ Add** in the left sidebar under **APIS AND FEATURES**.
  18. 1. Click **Add** for **Jira platform REST API** and then **Configure**.
  19. 1. Click **Add** next to the following scopes:
  20. - **View Jira issue data**
  21. - **View user profiles**
  22. - **Create and manage issues**
  23. ## GitLab configuration
  24. 1. On your GitLab server, open the configuration file:
  25. For Omnibus GitLab installations:
  26. ```shell
  27. sudo editor /etc/gitlab/gitlab.rb
  28. ```
  29. For installations from source:
  30. ```shell
  31. sudo -u git -H editor /home/git/gitlab/config/gitlab.yml
  32. ```
  33. 1. See [Initial OmniAuth Configuration](../../integration/omniauth.md#initial-omniauth-configuration) for initial settings to enable single sign-on and add `atlassian_oauth2` as an OAuth provider.
  34. 1. Add the provider configuration for Atlassian:
  35. For Omnibus GitLab installations:
  36. ```ruby
  37. gitlab_rails['omniauth_providers'] = [
  38. {
  39. name: "atlassian_oauth2",
  40. app_id: "YOUR_CLIENT_ID",
  41. app_secret: "YOUR_CLIENT_SECRET",
  42. args: { scope: 'offline_access read:jira-user read:jira-work', prompt: 'consent' }
  43. }
  44. ]
  45. ```
  46. For installations from source:
  47. ```yaml
  48. - name: "atlassian_oauth2",
  49. app_id: "YOUR_CLIENT_ID",
  50. app_secret: "YOUR_CLIENT_SECRET",
  51. args: { scope: 'offline_access read:jira-user read:jira-work', prompt: 'consent' }
  52. ```
  53. 1. Change `YOUR_CLIENT_ID` and `YOUR_CLIENT_SECRET` to the Client credentials you received in [application registration](#atlassian-application-registration) steps.
  54. 1. Save the configuration file.
  55. 1. [Reconfigure](../restart_gitlab.md#omnibus-gitlab-reconfigure) or [restart GitLab](../restart_gitlab.md#installations-from-source) for the changes to take effect if you installed GitLab via Omnibus or from source respectively.
  56. On the sign-in page there should now be an Atlassian icon below the regular sign in form. Click the icon to begin the authentication process.
  57. If everything goes right, the user is signed in to GitLab using their Atlassian credentials.