# Multi-user authentication

**URL:** <https://support.prodi.gy/t/multi-user-authentication/1572>\
**Category:** Uncategorized\
**Tags:** usage\
**Created:** [May 24, 2019, 4:41am UTC](https://support.prodi.gy/t/multi-user-authentication/1572 "2019-05-24T04:41:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![gilda](https://avatars.discourse-cdn.com/v4/letter/g/2acd7d/32.png) [@gilda](https://support.prodi.gy/u/gilda)\
**Post date:** [May 24, 2019, 4:41am UTC](https://support.prodi.gy/t/multi-user-authentication/1572/1 "2019-05-24T04:41:37Z")

</div>

Hi there,

First of all, thanks for adding the basic authentication for Prodigy in version 1.8.  
In our annotation project, we have a few users that are going to annotate text content. 1- Can each of them have their own user/pass? i.e. Can we add more than one user/pass for the basic authentication?  
2- What is the best way of adding user information as metadata to each session? We want to have different weight for annotations coming from different users.

More information: We have deployed Prodigy in a docker.

Thanks a lot!

---

<div class="post-metadata">

**Author:** ![ines](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/ines/32/3_2.png) [@ines](https://support.prodi.gy/u/ines)\
**Post date:** [May 24, 2019, 9:55am UTC](https://support.prodi.gy/t/multi-user-authentication/1572/2 "2019-05-24T09:55:27Z")

</div>

> [@gilda](#):
>
> 1- Can each of them have their own user/pass? i.e. Can we add more than one user/pass for the basic authentication?

Glad you find it useful! If you want different credentials per user, it's probably easiest to start each task as a separate process, and then use the environment variables to pass different username/password information to each process. The basic auth settings let you require authentication before accessing the API, but they do not have a concept of what a user "means".

> [@gilda](#):
>
> 2- What is the best way of adding user information as metadata to each session? We want to have different weight for annotations coming from different users.

In Prodigy v1.8, a key `"_session_id"` is automatically added to each example that's saved in the database. This consists of the dataset name (so that this info is preserved even when merging sets) and the session ID specified as `?session=` (or `"default"`). For instance, a session ID could be `cool_dataset-ines` or `cool_dataset-default`. This should let you implement you logic for both user datasets (if different annotators get different datasets) or multi-user sessions (if multiple named annotators are adding to the same dataset).

---

<div class="post-metadata">

**Author:** ![nix411](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/nix411/32/2982_2.png) [@nix411](https://support.prodi.gy/u/nix411)\
**Post date:** [July 2, 2019, 2:11pm UTC](https://support.prodi.gy/t/multi-user-authentication/1572/3 "2019-07-02T14:11:28Z")

</div>

How do you actually use the super basic authentication?

---

<div class="post-metadata">

**Author:** ![ines](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/ines/32/3_2.png) [@ines](https://support.prodi.gy/u/ines)\
**Post date:** [July 2, 2019, 2:24pm UTC](https://support.prodi.gy/t/multi-user-authentication/1572/4 "2019-07-02T14:24:42Z")

</div>

@nix411 You should be able to just set the environment variables `PRODIGY_BASIC_AUTH_USER` and `PRODIGY_BASIC_AUTH_PASS` on the command line when you run Prodigy. For example:

```bash
export PRODIGY_BASIC_AUTH_USER=username 
export PRODIGY_BASIC_AUTH_PASS=supersecret 
prodigy ner.teach ... # etc.

```
