Authentication

Open Source Auth
(with tons of integrations)

Every Supabase project comes with a complete User Management system that works without any additional tools.

Including PostgreSQL's policy engine, for fine-grained access rules.

auth header
auth header

google auth login iconfacebook auth login icon
gitlab auth login iconbitbucket auth login icontwitter auth login iconapple auth login icondiscord auth login iconmicrosoft auth login iconmessagebird auth login icontwilio auth login icontwitch auth login iconspotify auth login iconslack auth login icon

All the social providers

Enable social logins with the click of a button. Google, Facebook, GitHub, Azure, Gitlab, Twitter, Discord, and Bitbucket.

Fully integrated

Incredibly simple Auth, without a single external authentication service. Built-in Authentication, Authorization, and User Management.

Own your data

User data stored in your Supabase database so you never have to worry about 3rd party privacy issues. Host your data in 8 different locations.

Simple APIs

APIs that you can understand. With powerful libraries that work on client and server-side applications.

Enterprise logins

Support for SAML, Azure. More enterprise providers and SSO coming soon.

Social login scopes

Request additional user data permissions when using social logins.

1
2  // Sign up with email
3  const { user, error } = await supabase.auth.signUp({
4    email: 'example@email.com',
5    password: 'example-password',
6  })
7
8
9
10
11
12
13
14
15
16
17
18
19
20      
1
2  // Sign in with email
3  const { user, error } = await supabase.auth.signIn({
4    email: 'example@email.com',
5    password: 'example-password',
6  })
7
8
9
10
11
12
13
14
15
16
17
18
19      
1
2  // Sign in with magic links
3  const { user, error } = await supabase.auth.signIn({
4    email: 'example@email.com'
5  })
6
7
8
9
10
11  
12
13
14
15
16
17
18
19
20      
1
2  // Sign in with GitHub
3  // And request extra permissions!
4  const { user, error } = await supabase.auth.signIn({
5    provider: 'github',
6  }, {
7    scopes: 'repo gist notifications'
8  })
9
10
11
12
13
14
15
16
17
18
19
20
21      

Community driven examples, libraries and guides

Supported by a network of early advocates, contributors, and champions.

Svelte kanban board

A Trello clone using Supabase as the storage system.

Created by:joshnuss
NextJS Realtime chat app

NextJS Slack clone app using Supabase realtime subscriptions

Created by:supabase
Next.js Subscription and Auth

The all-in-one starter kit for high-performance SaaS applications.

Created by:Vercel
Expo Starter

Template bottom tabs with auth flow (Typescript)

Created by:codingki
NestJS example

NestJS example using Supabase Auth

Created by:hiro1107
ReactJS realtime chat app

Example app of real-time chat using supabase realtime api

Created by:shwosner
Vanilla-js Auth app

How to sign up and login using supabase and supabase-js using HTML and JavaScript only

Created by:supabase
React Native todo list app

React Native Todo List example with Expo

Created by:supabase
NextJS todo list app

NextJS todo list example

Created by:supabase
React todo list app

React todo List example

Created by:supabase
Svelte todo list app

Sveltejs todo with TailwindCSS and Snowpack

Created by:supabase
Vue.js todo list app

Vue.js todo app using TypeScript

Created by:supabase
Angular todo list app

Angular todo List example

Created by:geromegrignon

User permissions without the middleware

Supabase Auth works without any additional servers. Build Authorization rules with Postgres' Row Level Security, controlling who can create, edit and delete specific rows in your database.

Policies can be written in SQL or using the dashboard online.

1-- 1. Create table
2create table profiles (
3  id serial primary key,
4  name text
5);
6
7-- 2. Enable RLS
8alter table profiles enable row level security;
9
10-- 3. Create Policy
11create policy "Public profiles are viewable by everyone." 
12on profiles for select 
13using ( true );
1-- 1. Create table
2create table profiles (
3  id serial primary key,
4  name text
5);
6
7-- 2. Enable RLS
8alter table profiles enable row level security;
9
10-- 3. Create Policy
11create policy "Users can update their own profiles." 
12on profiles for update 
13using ( auth.uid() = id );
1create table teams (
2  id serial primary key,
3  name text
4);
5
6create table members (
7  team_id references team.id,
8  user_id referenced auth.users.id
9);
10
11alter table teams enable row level security;
12
13-- Create Advanced Policies
14create policy "Team members can update team details"
15on teams
16for update using (
17  auth.uid() in ( 
18    select user_id from members 
19    where team_id = id 
20  )
21);
Public profiles are viewable by everyone

Create a policy that allows public access to a table

Users can update their own profiles

Create a policy that only allows a user to update rows that match their unique ID

Team members can update team details

Create a policy that allows for team members to update only rows which match their team ID.

Acme Company

Sign in with
or continue with
1import React, { useState } from 'react'
2import { Auth, Typography, Button } from '@supabase/ui'
3import { createClient } from '@supabase/supabase-js'
4
5export default function app() {
6  const supabase = createClient(
7    "https://YOUR-PROJECT-ID.supabase.co",
8    "YOUR-PUBLIC-ANON-KEY"
9  );
10
11  function Container(props: any) {
12    const { user } = Auth.useUser();
13    if (user) {
14      return (
15        <div>
16          <Typography.Text>Signed in: {user.email}</Typography.Text>
17          <Button block onClick={() => props.supabaseClient.auth.signOut()}>
18            Sign out
19          </Button>
20        </div>
21      )
22    }
23    return props.children;
24  };
25
26  return (
27    <Auth.UserContextProvider supabaseClient={supabase}>
28      <Container supabaseClient={supabase}>
29        <Auth supabaseClient={supabase} />
30      </Container>
31    </Auth.UserContextProvider>
32  );
33}
34

React Auth

Pre-built auth widgets to get started in minutes.

Supabase provides React libraries which handle common scenarios, including logging in, signing up, magic link and forgot password forms.

Social login support

Support for social logins are built in and the component

User context hooks

Access the auth status from any component.

Build in a weekend, scale to millions