# How to specify which user (admin or read) is making calls in a weaviate client?

**URL:** <https://forum.weaviate.io/t/how-to-specify-which-user-admin-or-read-is-making-calls-in-a-weaviate-client/21553>\
**Category:** General\
**Created:** [June 28, 2025, 11:59am UTC](https://forum.weaviate.io/t/how-to-specify-which-user-admin-or-read-is-making-calls-in-a-weaviate-client/21553 "2025-06-28T11:59:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Othmane\_Hamzaoui1](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/othmane_hamzaoui1/32/7403_2.png) [@Othmane\_Hamzaoui1](https://forum.weaviate.io/u/Othmane_Hamzaoui1)\
**Post date:** [June 28, 2025, 11:59am UTC](https://forum.weaviate.io/t/how-to-specify-which-user-admin-or-read-is-making-calls-in-a-weaviate-client/21553/1 "2025-06-28T11:59:40Z")

</div>

I’m following the doc on how to set up Authorization in Weaviate [here](https://weaviate.io/developers/weaviate/configuration/authorization#admin-list-docker)

My config:

```auto
# docker compose: (env variables)
..
environment:
  AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED: 'false'
  AUTHENTICATION_APIKEY_ENABLED: 'true'
  AUTHENTICATION_APIKEY_ALLOWED_KEYS: 'key-1,key-2' 
  AUTHENTICATION_APIKEY_USERS: 'admin,read-only'
  AUTHORIZATION_ADMINLIST_ENABLED: 'true'
  AUTHORIZATION_ADMINLIST_USERS: 'admin'
  AUTHORIZATION_ADMINLIST_READONLY_USERS: 'read-only'

```

When instanciating the client (using weaviate 4.15.1):

```auto
import weaviate
from weaviate.connect import ConnectionParams
from weaviate.classes.init import Auth

weaviate_auth = Auth.api_key(os.environ["WEAVIATE_AUTH_KEY"])
weaviate_client = weaviate.WeaviateClient(
    connection_params=ConnectionParams.from_params(
     ...http and grpc configs
    ),
    auth_client_secret=weaviate_auth,
)

```

I don’t see any way in auth configuration or connection params to **specify which user is being used**. I tested passing different keys in `weaviate_auth` : `key-1` vs `key-2` and indeed when I pass `key-2` I can’t create an index (since `key-2` is mapped to a read only user)

**Is weaviate determining which user is making the API call based on the auth key ?**  
My guy feeling was to use the same auth key for both and mention in the client init which user am I using.

---

<div class="post-metadata">

**Author:** ![Shahin](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/shahin/32/8085_2.png) [@Shahin](https://forum.weaviate.io/u/Shahin)\
**Post date:** [June 29, 2025, 8:41am UTC](https://forum.weaviate.io/t/how-to-specify-which-user-admin-or-read-is-making-calls-in-a-weaviate-client/21553/2 "2025-06-29T08:41:44Z")

</div>

Hello @Othmane_Hamzaoui1,

Authentication is done via the API key assigned to a specific user. Each key is linked to a user identity in your Weaviate configuration (e.g., admin or read-only), and when you initialize the client with that key, Weaviate determines what level of access is granted based on the key used.

So, whether you use the admin-user-key or readonly-user-key, it directly controls which user is making the calls and what actions they’re allowed to perform.

I highly recommend reviewing the following documentation for more clarity:

**RBAC (Role-Based Access**

> **[RBAC Overview | Weaviate](https://weaviate.io/developers/weaviate/configuration/rbac)**
>
> Role-based access control (RBAC) is generally available in Weaviate from version v1.29.

**Authentication:**

> **[Authentication | Weaviate](https://weaviate.io/developers/weaviate/configuration/authentication)**
>
> Authentication and authorization are closely related concepts, and sometimes abbreviated as AuthN and AuthZ. Authentication (AuthN) is the process of verifying the identity of a user, while authorization (AuthZ) is the process of determining what...

**Authorization:**

> **[Authorization | Weaviate](https://weaviate.io/developers/weaviate/configuration/authorization)**
>
> Authentication and authorization are closely related concepts, and sometimes abbreviated as AuthN and AuthZ. Authentication (AuthN) is the process of verifying the identity of a user, while authorization (AuthZ) is the process of determining what...

Let me know if you have any questions

Best regards,

Mohamed Shahin  
Weaviate Support Engineer  
(Ireland, UTC±00:00/+01:00)
