# Obtaining Credentials

To obtain the necessary credentials for accessing the Sodot Rust SDK crate, follow these steps:

1. Enter using this link: https://repo.sodot.dev/

You can browse the private crates repository directly at: [https://repo.sodot.dev/artifactory/sodot-rust-crates/](https://repo.sodot.dev/artifactory/sodot-rust-crates/)

2. Sign in using the **sodot-auth** option

<img src="/img/obtaining_credentials/jfrog_login.png" title="Login" height={560} width={722} className="responsive-image jfrog-images" />

3. Once logged in, navigate to the user menu in the top right corner of the screen and locate your **username**.

<img src="/img/obtaining_credentials/jfrog_user_menu.png" title="User Menu" height={560} width={722} className="responsive-image jfrog-images" />

<img src="/img/obtaining_credentials/jfrog_username.png" title="Username" height={560} width={722} className="responsive-image jfrog-images" />

4. Click on **Set Me Up** → **Cargo** → Select the **sodot-rust-repo** repository.

<img src="/img/obtaining_credentials/jfrog_set_me_up_button.png" title="Set Me Up Button" height={560} width={722} className="responsive-image jfrog-images" />

<img src="/img/obtaining_credentials/jfrog_cargo_button.png" title="Cargo Button" height={560} width={722} className="responsive-image jfrog-images" />

<img src="/img/obtaining_credentials/jfrog_cargo_choose_repo.png" title="Choose Repo" height={560} width={722} className="responsive-image jfrog-images" />

5. Click the "Generate Token & Create Instructions" button.

<img src="/img/obtaining_credentials/jfrog_cargo_generate_token_button.png" title="Generate Token Button" height={560} width={722} className="responsive-image jfrog-images" />

6. Add the following registry configuration to your project's `.cargo/config.toml` file (create one if it doesn't exist):

```toml
[registries.sodot]
index = "sparse+https://repo.sodot.dev/artifactory/api/cargo/sodot-rust-crates/index/"
```

And copy the generated token from the UI (including the `Bearer ` prefix).
Run the following command to add the token to your `.cargo/config.toml` file:

```bash
cargo login --registry sodot
# Input the full token when requested (`Bearer xxxx`)
```

This will add the token to your local credentials store.

<img src="/img/obtaining_credentials/jfrog_token_generated_rust.png" title="Token Generated" height={560} width={722} className="responsive-image jfrog-images" />

:::note
The token is valid for **one year**. Make sure to regenerate it before it expires to avoid service disruptions.
:::

For any further questions, contact the [Sodot team](mailto\:sdk@sodot.dev).
