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
apple auth login icon
bitbucket auth login icon
discord auth login icon
facebook auth login icon
gitlab auth login icon
google auth login icon
messagebird auth login icon
microsoft auth login icon
slack auth login icon
spotify auth login icon
twitch auth login icon
twitter auth login icon
twilio auth login icon

All the social providers

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

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.

joshnuss GitHub profile picturejoshnuss

Next.js Realtime chat app

Next.js Slack clone app using Supabase realtime subscriptions

supabase GitHub profile picturesupabase

Next.js Subscription and Auth

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

Vercel GitHub profile pictureVercel

Expo Starter

Template bottom tabs with auth flow (Typescript)

codingki GitHub profile picturecodingki

NestJS example

NestJS example using Supabase Auth

hiro1107 GitHub profile picturehiro1107

ReactJS realtime chat app

Example app of real-time chat using supabase realtime api

shwosner GitHub profile pictureshwosner

Vanilla-js Auth app

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

supabase GitHub profile picturesupabase

React Native todo list app

React Native Todo List example with Expo

supabase GitHub profile picturesupabase

NextJS todo list app

NextJS todo list example

supabase GitHub profile picturesupabase

React todo list app

React todo List example

supabase GitHub profile picturesupabase

Svelte todo list app

Sveltejs todo with TailwindCSS and Snowpack

supabase GitHub profile picturesupabase

Vue.js todo list app

Vue.js todo app using TypeScript

supabase GitHub profile picturesupabase

Angular todo list app

Angular todo List example

geromegrignon GitHub profile picturegeromegrignon

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.

Build in a weekend, scale to millions