# Manage BaseSpace storage

Log in to Emedgene and navigate to Settings in the upper right-hand corner of the page.

<figure><img src="https://1131024994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGCW0DnLlE7QjoZPNmKIi%2Fuploads%2Fgit-blob-1c4914d014dad8fe823eda44d1eee46c86989833%2Fimage%20(7).png?alt=media" alt=""><figcaption></figcaption></figure>

Click on the Management tab and then on Add Storage.

<figure><img src="https://1131024994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGCW0DnLlE7QjoZPNmKIi%2Fuploads%2Fgit-blob-0df075be8a1cb2ea1369f3320b52e5391571d833%2Fimage%20(4)%20(2).png?alt=media" alt=""><figcaption></figcaption></figure>

Choose Illumina BaseSpace storage type.

<figure><img src="https://1131024994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGCW0DnLlE7QjoZPNmKIi%2Fuploads%2Fgit-blob-ac03832139bffa441943753adaa043d5c120e083%2Fimage%20(8).png?alt=media" alt=""><figcaption></figcaption></figure>

Fill Client Key, Client Secret and App Token as provided from BaseSpace (a description on how to get this information is provided below) and click Add storage to complete the setup.

* [Via Command Line](#via-command-line)
* [Via BaseSpace Developer Portal](#via-basespace-developer-portal)

### Via Command Line

#### Prerequisite

Install BaseSpace CLI (Command Line Interface)

```
# Linux
$ wget "https://launch.basespace.illumina.com/CLI/latest/amd64-linux/bs" -O $HOME/bin/bs
# Mac
$ wget "https://launch.basespace.illumina.com/CLI/latest/amd64-osx/bs" -O $HOME/bin/bs
# or
$ brew tap basespace/basespace && brew install bs-cli
# Windows
$ wget "https://launch.basespace.illumina.com/CLI/latest/amd64-windows/bs.exe" -O bs.exe
```

Follow the instructions on the [BaseSpace CLI Installation Page](https://developer.basespace.illumina.com/docs/content/documentation/cli/cli-overview) if needed. Be aware of the Basespace Regional Instance you are working on (us, euc1, aps2, euw2)

#### Authenticate

On BSSH, login to the workgroup you want to connect as the storage.

<figure><img src="https://1131024994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGCW0DnLlE7QjoZPNmKIi%2Fuploads%2Fgit-blob-06776b32a9c4ff756eef4fb39c48b846dacfbad8%2Fimage%20(9).png?alt=media" alt=""><figcaption><p>Example - connect integration1 workgroup as storage.</p></figcaption></figure>

Once the BaseSpace CLI is installed, run the authentication command in the terminal.

```
$ bs auth
```

The command will direct you to a link which requires to login.

After the authentication was completed successfully, find the access token in the config file.

```
$ cat .basespace/default.cfg
```

The result should look like -

```
apiServer   = https://api.basespace.illumina.com
accessToken = 
```

Populate the App\_token with the accessToken value, and Server with the apiServer URL from the BSSH config file.

Client\_key will be displayed in subsequent menus, so a descriptive name such as the workgroup name can be used.

Client\_secret is unused when the App\_token is available and can be set to "x".

<figure><img src="https://1131024994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGCW0DnLlE7QjoZPNmKIi%2Fuploads%2Fgit-blob-4a11f19fe151c12a458b0f3cd8d0e38f9c973d2a%2Fimage%20(6)%20(1).png?alt=media" alt=""><figcaption></figcaption></figure>

### Via BaseSpace Developer Portal

Go to the BaseSpace [developer portal](https://developer.basespace.illumina.com) and login. Be aware of the Basespace Regional Instance you are working on (us, [euc1](https://developer.euc1.sh.basespace.illumina.com/), [aps2](https://developer.aps2.sh.basespace.illumina.com/), [euw2](https://developer.euw2.sh.basespace.illumina.com/))

Go to My Apps and click Create a new Application.

<figure><img src="https://1131024994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGCW0DnLlE7QjoZPNmKIi%2Fuploads%2Fgit-blob-f1251fef93b2b9a749c48391e71112de8348a70a%2Fimage%20(10)%20(1).png?alt=media" alt=""><figcaption></figcaption></figure>

Fill details for the application and click on create an application.

<figure><img src="https://1131024994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGCW0DnLlE7QjoZPNmKIi%2Fuploads%2Fgit-blob-a40faa8514596549ea7aede76fce28cc2c8c9674%2Fimage%20(11).png?alt=media" alt=""><figcaption></figcaption></figure>

Fill details and press save.

<figure><img src="https://1131024994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGCW0DnLlE7QjoZPNmKIi%2Fuploads%2Fgit-blob-cf08e342a822625c88e2fce0ebfe69bbe5c2efd9%2Fimage%20(12).png?alt=media" alt=""><figcaption></figcaption></figure>

You will need to fill all the fields that it requested, please add “NA” to them.

<figure><img src="https://1131024994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGCW0DnLlE7QjoZPNmKIi%2Fuploads%2Fgit-blob-19cbd3ae2ea1be6d98d4226d01093469aaa1c5ec%2Fimage%20(43).png?alt=media" alt=""><figcaption></figcaption></figure>

Go to My Apps and click on your new app. Then go to the credentials tab.

<figure><img src="https://1131024994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGCW0DnLlE7QjoZPNmKIi%2Fuploads%2Fgit-blob-71e00fb38e9a973389a5bc4cf914eaeba03824db%2Fimage%20(1)%20(2).png?alt=media" alt=""><figcaption></figcaption></figure>

You will find the Client ID (Client Key), Client Secret and App Token to enter to Emedgene platform.

## Adding BSSH account to your Emedgene account

1. Log in into the desired Emedgene organization.
2. Go to Settings
3. Go to Management tab
4. Click on Add Storage
5. Select BaseSpace:

<figure><img src="https://1131024994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGCW0DnLlE7QjoZPNmKIi%2Fuploads%2Fgit-blob-d7f620ed194c8fdc8d277557f7c13d317098c4f6%2Fimage%20(44).png?alt=media" alt=""><figcaption></figcaption></figure>

6. Add the information from your “Credentials” of the App previously created in BSSH.

<figure><img src="https://1131024994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGCW0DnLlE7QjoZPNmKIi%2Fuploads%2Fgit-blob-c6cc8078bb348eaaf03f452a66a8d701c04d9ca5%2Fimage%20(45).png?alt=media" alt=""><figcaption></figcaption></figure>
