> For the complete documentation index, see [llms.txt](https://docs.lowcoder.cloud/lowcoder-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.lowcoder.cloud/lowcoder-documentation/connect-your-data/data-sources-in-lowcoder/sql-databases/supabase/supabase-oauth.md).

# Supabase OAuth

Lowcoder App users can authenticate their app users using the Supabase OAuth feature. It can be accessed through "supabase.auth".

Supabase Auth works with many popular Auth methods, including Social and Phone Auth using third-party providers and the list can be found <https://supabase.com/docs/guides/auth#providers> .

In order to Sign up a User through OAuth, we can use the following code :

```
const { data, error } = await supabase.auth.signInWithOAuth({
  provider: 'google',
  options: {
    redirectTo: 'https://example.com/welcome'
  }
})
```

We have to set the "Provider" that we need to use for Sign up. But, before running this query , We need to set the details related to OAuth on Supabase and on the Provider side, in this case Google. For setting up OAuth using Google, please follow the instructions written on this link : <https://supabase.com/docs/guides/auth/social-login/auth-google>

After successful sign in through OAuth, we can store the OAuth Provider token using following code :&#x20;

```
// Register this immediately after calling createClient!
// Because signInWithOAuth causes a redirect, you need to fetch the
// provider tokens from the callback.

supabase.auth.onAuthStateChange((event, session) => {
  if (session && session.provider_token) {
    window.localStorage.setItem('oauth_provider_token', session.provider_token)
  }
})
```

In the following Demo, we have shown how to setup Google OAuth using Supabase SDK :&#x20;

{% embed url="<https://demos.lowcoder.cloud/demo/cm348a4ma1853533h7m9qp11k>" %}
Setting up Google OAuth using Supabase SDK
{% endembed %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.lowcoder.cloud/lowcoder-documentation/connect-your-data/data-sources-in-lowcoder/sql-databases/supabase/supabase-oauth.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
