Skip to main content

Git Clone when SSO is Enabled

Problem

When users log into DataOps with SSO enabled they do not have a password set. In this case, they will see a banner for the project with the message:

DataOps.live banner

You won't be able to pull or push project code via HTTPS until you set a password on your account

Solution

For SSO you do not want and cannot set a user's password. Instead, to work with cloned repositories on your local machine you will use a Personal Access Token. Alternatively, you can use SSH keys with Git.

First, to create your token:

  1. go to User Settings > Personal Access Tokens
  2. set Token Name: repo_clone
  3. check under Select scopes checkbox: write_repository
  4. note down your token - you won't be able to access it again!

User Settings > Personal Access Tokens  __shadow__

Second, perform your git clone operation now as follows:

# git clone https://<access-token-name>:<access-token>@/app.dataops.live/group/project.git
git clone https://repo_clone:xxxxxxxxxxxxxxxxxxxx@app.dataops.live/group/project.git

Note that this stores the access token as plain text in the .git/config file. To avoid this you can use the git credential system. To do so, alter your steps to:

  1. modify ~/.git-credentials and add a line with the correct token

    https://repo_clone:xxxxxxxxxxxxxxxxxxxx@app.dataops.live
  2. perform the clone without the credentials in the URL

    git clone https://app.dataops.live/group/project.git