Accessing a SourceCraft repository with a personal access token (PAT)

To authenticate in SourceCraft and access repositories, you can use a personal access token (PAT).

To access a SourceCraft repository with a personal access token:

  1. Create a personal access token.
  2. Clone the repository.

If you no longer need token-based access, delete the token.

Create a personal access token

  1. Open the service home page.
  2. In the left-hand panel, click Home and go to Access Personal access tokens.
  3. On the Personal access tokens page, click Generate new token:
    • In the Token name field, specify a token name.

    • Optionally, in the Description field, enter a description for the token.

    • Select a token expiration date from the Expiration drop-down list.

      To set a custom expiration date, select Custom and specify the date when the token will expire.

    • Under Repository access, select the repositories to grant access to:

      • All repositories: Access to all your repositories.

      • Only selected repositories: Access to selected repositories only, no more than 10.

        In the Organization field, select the organization hosting your repository. In the Repository field, specify a name for the repository.

        To add another repository, click Add another repository.

      With a personal token, you will also have read access to all public repositories.

    • Under Permissions, select the repository roles that will be granted using the token.

  4. Click Generate token.
  5. In the window that opens:
    • Copy the personal token and save it in a secure location.

      Warning

      You will not be able to view the personal token value in the SourceCraft interface again.

    • Click Close, I’ve copied the token.

Clone the repository

  1. Install Git.

  2. In the top-right corner of the repository page, click Clone.

  3. Copy the link for cloning the repository from the HTTPS field.

  4. In the terminal, run this command:

    git clone <link_for_cloning_repository>
    
  5. Enter a username.

  6. Specify the personal token as the password.

  7. Go to your cloned repository:

    cd <repository_name>
    

Deleting a personal access token

  1. Open the service home page.
  2. In the left-hand panel, click Homeand go to Access Personal access tokens.
  3. On the Personal access tokens page, click next to the personal token you want to delete.
  4. Click I understand, delete this token.

See also