Configuring OAuth 2.0 for the Bitbucket Cloud
You can enable users to work with a remote Git repository that is hosted in the Bitbucket Cloud:
-
Set up an OAuth consumer (OAuth 2.0) in the Bitbucket Cloud.
-
Apply an OAuth consumer Secret for the Bitbucket Cloud.
Setting up an OAuth client in the Bitbucket Cloud
Set up an OAuth client for OAuth 2.0 in the Bitbucket Cloud.
-
You are logged in to the Bitbucket Cloud.
-
Click the Gear(Settings) icon and go to the Workspace Settings page.
-
Go to .
-
In the Details tab enter Che as the Name.
-
In the Authorization tab click the Authorization code checkbox and enter
https://<che_fqdn>/api/oauth/callbackas the Callback URL. -
In the Copes tab check all of the Account and Repositories checkboxes, and click Save.
-
Copy and save the Client ID value for use when applying the Bitbucket OAuth client Secret:
-
Copy and save the Secret value for use when applying the Bitbucket OAuth client Secret.
Applying an OAuth client Secret for the Bitbucket Cloud
Prepare and apply an OAuth client Secret for the Bitbucket Cloud.
-
The OAuth client is set up in the Bitbucket Cloud.
-
The following values, which were generated when setting up the Bitbucket OAuth client, are prepared:
-
Bitbucket OAuth client ID
-
Bitbucket OAuth client Secret
-
-
An active
kubectlsession with administrative permissions to the destination Kubernetes cluster. See Overview of kubectl.
-
Prepare the Secret:
kind: Secret apiVersion: v1 metadata: name: bitbucket-oauth-config namespace: eclipse-che (1) labels: app.kubernetes.io/part-of: che.eclipse.org app.kubernetes.io/component: oauth-scm-configuration annotations: che.eclipse.org/oauth-scm-server: bitbucket type: Opaque stringData: id: <Bitbucket_Oauth_client_Key> (2) secret: <Bitbucket_Oauth_client_Secret> (3)1 The Che namespace. The default is eclipse-che.2 The Bitbucket OAuth client ID. 3 The Bitbucket OAuth client Secret. -
Apply the Secret:
$ kubectl apply -f - <<EOF <Secret_prepared_in_the_previous_step> EOF
-
Verify in the output that the Secret is created.