|
| 1 | +--- |
| 2 | +stage: Ecosystem |
| 3 | +group: Integrations |
| 4 | +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 |
| 5 | +--- |
| 6 | + |
| 7 | +# Use AliCloud as an OmniAuth authentication provider **(FREE)** |
| 8 | + |
| 9 | +You can enable the AliCloud OAuth 2.0 OmniAuth provider and sign in to |
| 10 | +GitLab using your AliCloud account. |
| 11 | + |
| 12 | +## Create an AliCloud application |
| 13 | + |
| 14 | +Sign in to the AliCloud platform and create an application on it. AliCloud generates a client ID and secret key for you to use. |
| 15 | + |
| 16 | +1. Sign in to the [AliCloud platform](https://account.aliyun.com/login/login.htm). |
| 17 | + |
| 18 | +1. Go to the [OAuth application management page](https://ram.console.aliyun.com/applications). |
| 19 | + |
| 20 | +1. Select **Create Application**. |
| 21 | + |
| 22 | +1. Fill in the application details: |
| 23 | + |
| 24 | + - **Application Name**: This can be anything. |
| 25 | + - **Display Name**: This can be anything. |
| 26 | + - **Callback URL**: This URL should be formatted as `'GitLab instance URL' + '/users/auth/alicloud/callback'`. For example, `http://test.gitlab.com/users/auth/alicloud/callback`. |
| 27 | + |
| 28 | + Select **Save**. |
| 29 | + |
| 30 | +1. Add OAuth scopes in the application details page: |
| 31 | + |
| 32 | + 1. Under the **Application Name** column, select the name of the application you created. The application's details page opens. |
| 33 | + 1. Under the **Application OAuth Scopes** tab, select **Add OAuth Scopes**. |
| 34 | + 1. Select the **aliuid** and **profile** checkboxes. |
| 35 | + 1. Select **OK**. |
| 36 | + |
| 37 | +  |
| 38 | + |
| 39 | +1. Create a secret in the application details page: |
| 40 | + |
| 41 | + 1. Under the **App Secrets** tab, select **Create Secret**. |
| 42 | + 1. Copy the SecretValue generated. |
| 43 | + |
| 44 | +## Enable AliCloud OAuth in GitLab |
| 45 | + |
| 46 | +1. On your GitLab server, open the configuration file. |
| 47 | + |
| 48 | + - **For Omnibus installations** |
| 49 | + |
| 50 | + ```shell |
| 51 | + sudo editor /etc/gitlab/gitlab.rb |
| 52 | + ``` |
| 53 | + |
| 54 | + - **For installations from source** |
| 55 | + |
| 56 | + ```shell |
| 57 | + cd /home/git/gitlab |
| 58 | +
|
| 59 | + sudo -u git -H editor config/gitlab.yml |
| 60 | + ``` |
| 61 | + |
| 62 | +1. [Configure the initial settings](omniauth.md#configure-initial-settings). |
| 63 | + |
| 64 | +1. Add the provider configuration. Replace `YOUR_APP_ID` with the ID on the application details page |
| 65 | + and `YOUR_APP_SECRET` with the **SecretValue** you got when you registered the AliCloud application. |
| 66 | + |
| 67 | + - **For Omnibus installations** |
| 68 | + |
| 69 | + ```ruby |
| 70 | + gitlab_rails['omniauth_providers'] = [ |
| 71 | + { |
| 72 | + name: "alicloud", |
| 73 | + app_id: "YOUR_APP_ID", |
| 74 | + app_secret: "YOUR_APP_SECRET" |
| 75 | + } |
| 76 | + ] |
| 77 | + ``` |
| 78 | + |
| 79 | + - **For installations from source** |
| 80 | + |
| 81 | + ```yaml |
| 82 | + - { name: 'alicloud', |
| 83 | + app_id: 'YOUR_APP_ID', |
| 84 | + app_secret: 'YOUR_APP_SECRET' } |
| 85 | + ``` |
| 86 | +
|
| 87 | +1. Save the configuration file. |
| 88 | +
|
| 89 | +1. [Reconfigure GitLab](../administration/restart_gitlab.md#omnibus-gitlab-reconfigure) |
| 90 | + if you installed using Omnibus, or [restart GitLab](../administration/restart_gitlab.md#installations-from-source) |
| 91 | + if you installed from source. |
0 commit comments