# Retrieve User ID

Depending on the [<mark style="color:blue;">Bucket Types</mark>](https://docs.ionos.com/sections-test/guides/storage-and-backup/ionos-object-storage/concepts/bucket-types) access you want to share with the user, learn how to retrieve the required user ID.

## Retrieve your user ID

For another user to share the content of their <code class="expression">space.vars.ionos\_cloud\_object\_storage</code> with you, they need your user ID, which you will find in the Object Storage **Key Management** section.

{% hint style="info" %}
**Prerequisite:**

* Make sure you have the corresponding permissions to work with the Object Storage. If you are not the contract owner or administrator, you must be added to a group with **Use Object Storage** privilege.
* You must have generated the first Object Storage key using [<mark style="color:blue;">Generate a Key</mark>](https://docs.ionos.com/sections-test/guides/storage-and-backup/ionos-object-storage/get-started/generate-key). Only on generating the first key, the **Canonical User ID** of the user is displayed in the [<mark style="color:blue;">Credentials</mark>](https://docs.ionos.com/sections-test/guides/storage-and-backup/concepts/key-management#object-storage-credentials) and **Users & Groups** > **Users** > **Object Storage Keys** > **IDs** section.
  {% endhint %}

1\. In the **DCD**, go to **Menu** > **Storage & Backup** > **IONOS Object Storage**.

2\. Select the **Key management** tab.

3\. In the **Object Storage Credentials**, click **Copy** against the user's ID as follows:

* Copy the **Contract User ID** to grant access to contract-owned buckets.
* Copy the **Canonical User ID** to grant access to user-owned buckets.

![Copy user ID](https://1737632334-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MifAzdGvKLDTtvJP8sm%2Fuploads%2Fgit-blob-2e46a18d8b1b6139262480f1fbe0d0ecdddc9286%2Fs3-own-user-id.png?alt=media)

{% hint style="success" %}
**Result:** Your user ID is successfully copied to the clipboard.
{% endhint %}

## Retrieve the user ID of a grantee

The grantee is the user under the same contract at IONOS Cloud, but it also could be the user under another contract. You need the user ID to share access to the bucket or object using [<mark style="color:blue;">Share access</mark>](https://docs.ionos.com/sections-test/guides/storage-and-backup/concepts/access-management#share-access) methods.

{% hint style="info" %}
**Prerequisites**:

* Make sure the grantee Object Storage account already exists. If not, then, begin creating the grantee by following the steps to [<mark style="color:blue;">Retrieve the user ID of a new user</mark>](#retrieve-the-user-id-of-a-new-user).
* Make sure you have the corresponding permission to work with the Object Storage. You must be added to a group with **Use Object Storage** privilege. Only contract owners and administrators can retrieve the <code class="expression">space.vars.ionos\_cloud\_object\_storage</code> IDs of their account users.
* Only on generating the first [<mark style="color:blue;">object storage key</mark>](https://docs.ionos.com/sections-test/guides/storage-and-backup/ionos-object-storage/get-started/generate-key), the **Canonical User ID** of the user is displayed in the **Users & Groups** > **Users** > **Object Storage Keys** > **IDs** section.
  {% endhint %}

1\. In the **DCD**, go to **Menu** > **Management** > **Users & Groups**.

2\. Select the user from the **Users** list and click the **Object Storage Keys** tab.

3\. Click the **Object Storage** link and retrieve the user's ID as follows:

* Copy the **Contract User ID** to grant access to contract-owned buckets.
* Copy the **Canonical User ID** to grant access to user-owned buckets.

![Copy user ID](https://1737632334-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MifAzdGvKLDTtvJP8sm%2Fuploads%2Fgit-blob-cda81a28f12497220858c067d6289c002a865e9d%2Fs3-user-id.png?alt=media)

{% hint style="success" %}
**Result:** The user ID for the grantee is successfully retrieved.
{% endhint %}

## Retrieve the user ID of a new user

If the grantee's user account does not already exist or you want to assign a different set of permissions, then the root user of the contract needs to create the user account and then retrieve the user ID to grant access to buckets and objects.

1\. In the **DCD**, go to **Menu** > **Management** > **Users & Groups**.

2\. In the **Users** tab, click **+ Create**.

3\. Enter the user details such as **First Name**, **Last Name**, **Email**, **Password**, and click **Create**.

![Create a user](https://1737632334-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MifAzdGvKLDTtvJP8sm%2Fuploads%2Fgit-blob-b6f20bbe5f3df6ce2c59c0d6a6bb21065b7c232c%2Fs3-new-user.png?alt=media)

{% hint style="success" %}
**Result:** The new user is created and shown in the **Users** list.
{% endhint %}

4\. Add the user to a group with **Use Object Storage** privilege enabled.

5\. The user must log in to the [<mark style="color:blue;">DCD</mark>](https://docs.ionos.com/sections-test/guides/set-up-ionos-cloud/get-started/log-in-dcd) with their credentials and manually generate the Object Storage key by using [<mark style="color:blue;">Generate a Key</mark>](https://docs.ionos.com/sections-test/guides/storage-and-backup/ionos-object-storage/get-started/generate-key).

{% hint style="info" %}
**Info:** Only on generating the first key, the **Canonical User ID** of the user is displayed in the [<mark style="color:blue;">Object Storage Credentials</mark>](https://docs.ionos.com/sections-test/guides/storage-and-backup/concepts/key-management#object-storage-credentials) and **Users & Groups** > **Users** > **Object Storage Keys** > **IDs** section.
{% endhint %}

6\. In the **Users** list, select the user and click the **Object Storage Keys** tab.

5\. Select the **Active** checkbox to activate the Key.

![Activate the Key](https://1737632334-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MifAzdGvKLDTtvJP8sm%2Fuploads%2Fgit-blob-fadea53d944b679bf2731ab6eac2af684d3e1bf4%2Fs3-activate-key.png?alt=media)

6\. Click the **Object Storage** link and retrieve the user's ID as follows:

* Copy the **Contract User ID** to grant access to contract-owned buckets.
* Copy the **Canonical User ID** to grant access to user-owned buckets.

![Copy user ID](https://1737632334-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MifAzdGvKLDTtvJP8sm%2Fuploads%2Fgit-blob-cda81a28f12497220858c067d6289c002a865e9d%2Fs3-user-id.png?alt=media)

{% hint style="success" %}
**Result:** The new user is successfully created and the user ID is retrieved. You can now share access to the bucket with the new user using [<mark style="color:blue;">Share access</mark>](https://docs.ionos.com/sections-test/guides/storage-and-backup/concepts/access-management#share-access).
{% endhint %}
