You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Experimental: We've also heard from the community that Supabase's newly released [support for external auth providers works](https://supabase.com/blog/third-party-auth-mfa-phone-send-hooks), but we don't have any examples for this yet.
19
19
20
-
<Note>
21
-
The "Supabase Auth" setting no longer works for Supabase projects created after 25 November 2024. While we are working with Supabase on a fix, please apply this workaround: https://releases.powersync.com/announcements/important-notice-for-supabase-users-using-supabase-jwts
22
-
</Note>
20
+
To implement either **Supabase Auth** or **Anonymous Sign-Ins**, enable the "Use Supabase Auth" setting on the PowerSync instance, and provide your Supabase JWT Secret. Internally, this setting allows PowerSync to verify and use Supabase JWTs directly using HS256 and the provided secret.
23
21
24
-
To implement either Supabase Auth or Anonymous Sign-Ins, enable the "Use Supabase Auth" setting on the PowerSync instance. (This is also [covered in the Supabase & PowerSync integration guide](/integration-guides/supabase-+-powersync#configuring-powersync))
22
+
Enabling Supabase Auth is also [covered in the Supabase & PowerSync integration guide](/integration-guides/supabase-+-powersync#configuring-powersync).
25
23
26
-
Internally, Supabase auth signs the token using HS256, using a secret available as `current_setting('app.settings.jwt_secret')` on the database.
24
+
To rotate the secret, generate a new secret in the your Supabase project's API Settings:
27
25
28
-
To rotate the secret, generate a new secret in the Supabase project settings. The new secret will be automatically picked up by PowerSync within 5 minutes. In this period, some authentication failures are expected.
The Supabase user UUID will be available as `token_parameters.user_id`. To use a different identifier as the user ID in sync rules (for example user email), use [Custom authentication](/installation/authentication-setup/custom).
30
+
The Supabase user UUID will be available as `request.user_id()` in Sync Rules. To use a different identifier as the user ID in sync rules (for example user email), use [Custom authentication](/installation/authentication-setup/custom).
1. Replace `[YOUR-PASSWORD]` with the password for the `postgres` user in your Supabase database.
30
-
* Supabase also [refers to this password](https://supabase.com/docs/guides/database/managing-passwords) as the _database password_ or _project password_.
31
-
2. PowerSync has the Supabase CA certificate pre-configured — `verify-full` SSL mode can be used directly, without any custom certificates.
32
-
3. Under `client_auth` enable Supabase Auth:
33
-
34
-
```yaml
35
-
client_auth:
36
-
supabase: true
37
-
```
11
+
1. In your Supabase dashboard, navigate to **"Project Settings"**\-> **"Database" -> "Connection string**" and select the "URI" tab.
12
+
2. Uncheck the "**Display connection pooler**" checkbox. PowerSync needs to connect to the database directly and cannot use the pooler.
13
+
<Frame>
14
+
<imgsrc="/images/self-hosting-3.avif"/>
15
+
</Frame>
16
+
3. Copy the connection string. The hostname should be `db.<PROJECT-ID>.supabase.co`, and not, for example, `aws-0-us-west-1.pooler.supabase.com`.
17
+
4. Paste this URI into the `uri` field under `replication`\>`connections` in your configuration file, for example:
5. Replace `[YOUR-PASSWORD]` with the password for the `postgres` user in your Supabase database.
29
+
* Supabase also [refers to this password](https://supabase.com/docs/guides/database/managing-passwords) as the _database password_ or _project password_.
30
+
6. PowerSync has the Supabase CA certificate pre-configured — `verify-full` SSL mode can be used directly, without any custom certificates.
31
+
7. Under `client_auth` enable Supabase Authentication:
32
+
33
+
```yaml
34
+
client_auth:
35
+
supabase: true
36
+
supabase_jwt_secret: [secret]
37
+
```
38
+
For more details, see [Supabase Auth](/installation/authentication-setup/supabase-auth).
38
39
</Accordion>
39
40
<Accordion title="AWS RDS">
40
41
Add your connection details under `replication` \> `connections` in your configuration file.
0 commit comments