12.3.5.6. Dev Workspace エンジンを使用した GitLab OAuth2 の設定
前提条件
- GitLab サーバーが実行中であり、CodeReady Workspaces から利用できる。
手順
Gitlab で OAuth2 認証 アプリケーション を作成します。
-
アプリケーションの
Nameとして Che と入力します。 -
Redirect URIとして、CodeReady Workspaces OAuth コールバック URL を入力します。デフォルト値はhttps://codeready-openshift-workspaces.<domain>/api/oauth/callbackです。 -
ConfidentialおよびExpire access tokensのチェックボックスを選択します。 -
Scopes の下で、
api、write_repository、およびopenidのチェックボックスにチェックを入れます。
-
アプリケーションの
-
Save applicationをクリックし、Application IDおよびSecretの値を保存します。 CodeReady Workspaces がデプロイされているプロジェクトで新規シークレットを作成します。
$ oc apply -f - <<EOF kind: Secret apiVersion: v1 metadata: name: gitlab-oauth-config namespace: <namespace>1 labels: app.kubernetes.io/part-of: che.eclipse.org app.kubernetes.io/component: oauth-scm-configuration annotations: che.eclipse.org/oauth-scm-server: gitlab che.eclipse.org/scm-server-endpoint: <your_GitLab_service_URL> type: Opaque data: id: <base64_encoded_GitLab_Application_ID> secret: <base64_encoded_GitLab_Secret> EOF- 1
- CodeReady Workspaces namespace。デフォルトは openshift-workspaces です。