9.3.5.2. Bitbucket Server OAuth 1 の設定
この手順では、Bitbucket Server の OAuth 1 をアクティベートして以下を実行する方法を説明します。
- Bitbucket Server でホストされる devfile を使用します。
- SCM サーバーのプライベートリポジトリーでユーザーを認証する。
これは CodeReady Workspaces が Bitbucket Server Personal アクセストークンを取得し、更新できるようにします。
前提条件
-
ocツールが利用できる。 - Bitbucket サーバーは、CodeReady Workspaces サーバーから利用できます。
手順
RSA キーペアと公開鍵の省略バージョンを生成します。
openssl genrsa -out <private.pem> 2048 openssl rsa -in <private.pem> -pubout > <public.pub> openssl pkcs8 -topk8 -inform pem -outform pem -nocrypt -in <private.pem> -out <privatepkcs8.pem> cat <public.pub> | sed 's/-----BEGIN PUBLIC KEY-----//g' | sed 's/-----END PUBLIC KEY-----//g' | tr -d '\n' > <public-stripped.pub>
openssl genrsa -out <private.pem> 2048 openssl rsa -in <private.pem> -pubout > <public.pub> openssl pkcs8 -topk8 -inform pem -outform pem -nocrypt -in <private.pem> -out <privatepkcs8.pem> cat <public.pub> | sed 's/-----BEGIN PUBLIC KEY-----//g' | sed 's/-----END PUBLIC KEY-----//g' | tr -d '\n' > <public-stripped.pub>Copy to Clipboard Copied! Toggle word wrap Toggle overflow コンシューマーキーと共有シークレットを生成します。
openssl rand -base64 24 > <bitbucket_server_consumer_key> openssl rand -base64 24 > <bitbucket_shared_secret>
openssl rand -base64 24 > <bitbucket_server_consumer_key> openssl rand -base64 24 > <bitbucket_shared_secret>Copy to Clipboard Copied! Toggle word wrap Toggle overflow コンシューマーおよびプライベートキーを含む Kubernetes シークレットを CodeReady Workspaces namespace に作成します。
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Bitbucket でアプリケーションリンクを設定し、CodeReady Workspaces から Bitbucket サーバーへの通信を有効にします。
- Bitbucket Server で上部のナビゲーションバーをクリックし、Administration > Application Links に移動します。
-
アプリケーション URL:
\https://codeready-<openshift_deployment_name>.<domain_name>を入力し、 ボタンをクリックします。
- 「No response was received from the URL」という警告メッセージが表示されたら ボタンをクリックします。
Link Applications フォームを入力し、 ボタンをクリックします。
- Application Name
-
<CodeReady Workspaces> - Application Type
- Generic Application
- Service Provider Name
-
<CodeReady Workspaces> - Consumer Key
-
<bitbucket_server_consumer_key>ファイルの内容を貼り付けます。 - Shared secret
-
<bitbucket_shared_secret>ファイルの内容を貼り付けます。 - Request Token URL
-
<Bitbucket Server URL>/plugins/servlet/oauth/request-token - アクセストークン URL
-
<Bitbucket Server URL>/plugins/servlet/oauth/access-token - Authorize URL
-
<Bitbucket Server URL>/plugins/servlet/oauth/access-token - Create incoming link
- Enabled
Link Applications フォームを入力し、 ボタンをクリックします。
- Consumer Key
-
<bitbucket_server_consumer_key>ファイルの内容を貼り付けます。 - Consumer name
-
<CodeReady Workspaces> - Public Key
-
<public-stripped.pub>ファイルの内容を貼り付けます。