# Need some help with Supabase Auth and roles

**URL:** https://community.weweb.io/t/need-some-help-with-supabase-auth-and-roles/15493
**Category:** Ask us anything
**Created:** [January 21, 2025, 2:24pm UTC](https://community.weweb.io/t/need-some-help-with-supabase-auth-and-roles/15493 "2025-01-21T14:24:12Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![romu](https://avatars.discourse-cdn.com/v4/letter/r/db5fbb/32.png) [@romu](https://community.weweb.io/u/romu)
#### Post date: [January 21, 2025, 2:24pm UTC](https://community.weweb.io/t/need-some-help-with-supabase-auth-and-roles/15493/1 "2025-01-21T14:24:13Z")

</div>

Hi.  
I’m a WeWeb beginner with a tech background. Currently, I’m nocoding the authentication part of my future app, using Supabase (and the Auth plugin) as the back-end.

The register/login/logout part works well, thanks for the JK video tutorials.

Following the WeWeb docs, I’ve implemented the roles part, and I’m facing issues. The make things more simple for the time being, I disabled RLS on all my tables. I know it’s not a good practise, but I need to check step by step where the problem is.

In WeWeb Supabase Auth plugin setup, I selected the tables related to roles management, and it works.  
My roles table contains 4 roles which are all fetched by WeWeb (Auth → Roles)

But on WeWeb → Auth → Users, the console shows an error 400 and my 2 users accounts are not fetched:

 ![image](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/3/3a84c03074464a22ccea855b64a40aedc39ed72f.png)

 ![image](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/7/7aebd1a6d009e4962c5b6b915fbf5b9e834853cf.png)

Any idea about what could be wrong?

Thanks

---

<div class="post-metadata">

### Author: ![sleeusis](https://avatars.discourse-cdn.com/v4/letter/s/d07c76/32.png) [@sleeusis](https://community.weweb.io/u/sleeusis)
#### Post date: [January 21, 2025, 2:42pm UTC](https://community.weweb.io/t/need-some-help-with-supabase-auth-and-roles/15493/2 "2025-01-21T14:42:36Z")

</div>

Under Supabase → Auth plugin do you have both the Role and the User Role table associated from your Supabase?

---

<div class="post-metadata">

### Author: ![romu](https://avatars.discourse-cdn.com/v4/letter/r/db5fbb/32.png) [@romu](https://community.weweb.io/u/romu)
#### Post date: [January 21, 2025, 2:45pm UTC](https://community.weweb.io/t/need-some-help-with-supabase-auth-and-roles/15493/3 "2025-01-21T14:45:49Z")

</div>

Absolutely. Thanks for getting in, and to remind me that I forgot to mention this point.

 ![Screenshot 2025-01-21 at 15.45.08](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/2/2fdbd8751165c99f8e7398c848eab3672c2a94c7.png)

---

<div class="post-metadata">

### Author: ![romu](https://avatars.discourse-cdn.com/v4/letter/r/db5fbb/32.png) [@romu](https://community.weweb.io/u/romu)
#### Post date: [January 21, 2025, 2:54pm UTC](https://community.weweb.io/t/need-some-help-with-supabase-auth-and-roles/15493/4 "2025-01-21T14:54:09Z")

</div>

Here are the 4 roles:

 ![Screenshot 2025-01-21 at 15.53.47](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/b/b4b647a13aac97242beb47f3f7f016e837a0d073.png)

And the 2 associations (2 users, one role for each of them):

 ![Screenshot 2025-01-21 at 15.52.49](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/8/8f21645381a11b21d88e6a904f18ce8276b37878.png)

---

<div class="post-metadata">

### Author: ![sleeusis](https://avatars.discourse-cdn.com/v4/letter/s/d07c76/32.png) [@sleeusis](https://community.weweb.io/u/sleeusis)
#### Post date: [January 21, 2025, 2:57pm UTC](https://community.weweb.io/t/need-some-help-with-supabase-auth-and-roles/15493/5 "2025-01-21T14:57:21Z")

</div>

did you set the "Service Role key: on the auth plugin?

---

<div class="post-metadata">

### Author: ![romu](https://avatars.discourse-cdn.com/v4/letter/r/db5fbb/32.png) [@romu](https://community.weweb.io/u/romu)
#### Post date: [January 21, 2025, 3:08pm UTC](https://community.weweb.io/t/need-some-help-with-supabase-auth-and-roles/15493/6 "2025-01-21T15:08:58Z")

</div>

I think so.

 ![image](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/1/139d1a52e51c10d1d6bc2e29376cc2e40cf0b52c.png)

---

<div class="post-metadata">

### Author: ![sleeusis](https://avatars.discourse-cdn.com/v4/letter/s/d07c76/32.png) [@sleeusis](https://community.weweb.io/u/sleeusis)
#### Post date: [January 21, 2025, 4:13pm UTC](https://community.weweb.io/t/need-some-help-with-supabase-auth-and-roles/15493/7 "2025-01-21T16:13:19Z")

</div>

not too sure why but if you follow this it should work fine

> **[Supabase authentication | WeWeb Documentation](https://docs.weweb.io/plugins/auth-systems/supabase-auth.html#plugin-configuration)**
>
> Learn how to work with Supabase auth in WeWeb

and

> **[Supabase authentication | WeWeb Documentation](https://docs.weweb.io/plugins/auth-systems/supabase-auth.html#user-roles-permissions)**
>
> Learn how to work with Supabase auth in WeWeb

---

<div class="post-metadata">

### Author: ![romu](https://avatars.discourse-cdn.com/v4/letter/r/db5fbb/32.png) [@romu](https://community.weweb.io/u/romu)
#### Post date: [January 21, 2025, 4:31pm UTC](https://community.weweb.io/t/need-some-help-with-supabase-auth-and-roles/15493/8 "2025-01-21T16:31:05Z")

</div>

Thanks. This is the page I read every night before sleeping 😂

---

<div class="post-metadata">

### Author: ![romu](https://avatars.discourse-cdn.com/v4/letter/r/db5fbb/32.png) [@romu](https://community.weweb.io/u/romu)
#### Post date: [January 22, 2025, 9:22am UTC](https://community.weweb.io/t/need-some-help-with-supabase-auth-and-roles/15493/9 "2025-01-22T09:22:22Z")

</div>

Still stuck on this step.

I’ve tried to change the `user_roles` table to `userRoles`, and the `xxx_id` to `xxx_Id`, to reflect exactly what’s on the tutorial (even if I guessed the problem was not this one), and…it works !!! 🥳

So for everyone reading this message, you must respect the naming convention shown in the tutorial for the roles, user roles, tables and their fields.
