mirror of
https://github.com/supabase/supabase.git
synced 2026-10-05 09:25:06 +03:00
docs: improve text in auth deep dive section (#18392)
This commit is contained in:
1 parent
6e14a75c62
commit
b6ac2a3756
2 files changed
+17
-17
No files matched your search
@@ -2,7 +2,7 @@ import Layout from '~/layouts/DefaultGuideLayout'
|
||||
|
||||
export const meta = {
|
||||
id: 'auth-google-oauth',
|
||||
title: 'Part Five: Google Oauth',
|
||||
title: 'Part Five: Google OAuth',
|
||||
description: 'Supabase Deep Dive Part 5: Google OAuth Provider',
|
||||
video: 'https://www.youtube.com/v/_XM9ziOzWk4',
|
||||
}
|
||||
@@ -24,9 +24,9 @@ How to add Google OAuth Logins to your Supabase Application.
|
||||
|
||||
### Logging in with external OAuth providers
|
||||
|
||||
Connecting social logins such as Google, GitHub, or Facebook couldn't be easier. In this guide we'll walk you through the process of connecting Google, but the process is basically the same for all of the providers which includes: azure, bitbucket, github, gitlab, facebook, and google.
|
||||
Connecting social logins such as Google, GitHub, or Facebook couldn't be easier. In this guide we'll walk you through the process of connecting Google, but the process is basically the same for all of the providers which includes: Azure, Bitbucket, GitHub, GitLab, Facebook, and Google.
|
||||
|
||||
First you'll need to create a google project inside their [cloud console](https://console.cloud.google.com/home/dashboard), in other providers they may refer to this as an "app" and is usually available on the company's developer portal.
|
||||
First you'll need to create a Google project inside their [cloud console](https://console.cloud.google.com/home/dashboard), in other providers they may refer to this as an "app" and is usually available on the company's developer portal.
|
||||
|
||||

|
||||
|
||||
@@ -44,17 +44,17 @@ Next open up Credentials page on the left
|
||||
|
||||
And click to create a new set of credentials, select OAuth client ID as the option
|
||||
|
||||

|
||||

|
||||
|
||||
Now choose Web Application (assuming you're creating a web app) and in the Authorized redirect URI section you need to add: `https://<your-ref>.supabase.co/auth/v1/callback`. You can find your Supabase URL in Settings > API inside the Supabase dashboard.
|
||||
|
||||

|
||||
|
||||
Now you can grab the client ID and secret from the popup, and insert them into the google section inside the Supabase dashboard in Auth > Settings:
|
||||
Now you can grab the client ID and secret from the popup, and insert them into the Google section inside the Supabase dashboard in Auth > Settings:
|
||||
|
||||

|
||||
|
||||

|
||||

|
||||
|
||||
Hit save. Now you should be able to navigate in the browser to:
|
||||
|
||||
@@ -62,7 +62,7 @@ Hit save. Now you should be able to navigate in the browser to:
|
||||
https://<your-ref>.supabase.co/auth/v1/authorize?provider=google
|
||||
```
|
||||
|
||||
And log in to your service using any google or gmail account.
|
||||
And log in to your service using any Google or Gmail account.
|
||||
|
||||
You can additionally add a query parameter `redirect_to=` to the end of the URL for example:
|
||||
|
||||
@@ -74,7 +74,7 @@ But make sure any URL you enter here is on the same host as the site url that yo
|
||||
|
||||
If you want to redirect the user to a specific page in your website or app after a successful authentication.
|
||||
|
||||
You also have the option of requesting additional scopes from the oauth provider. Let's say for example you want the ability to send emails on behalf of the user's gmail account. You can do this by adding the query parameter `scopes`, like:
|
||||
You also have the option of requesting additional scopes from the OAuth provider. Let's say for example you want the ability to send emails on behalf of the user's gmail account. You can do this by adding the query parameter `scopes`, like:
|
||||
|
||||
```
|
||||
https://<your-ref>.supabase.co/auth/v1/authorize?provider=google&https://www.googleapis.com/auth/gmail.send
|
||||
|
||||
@@ -3,7 +3,7 @@ import Layout from '~/layouts/DefaultGuideLayout'
|
||||
export const meta = {
|
||||
id: 'auth-gotrue',
|
||||
title: 'Part Four: GoTrue',
|
||||
description: 'Supabase Deep Dive Part 4: Gotrue Overview',
|
||||
description: 'Supabase Deep Dive Part 4: GoTrue Overview',
|
||||
}
|
||||
|
||||
### About
|
||||
@@ -21,9 +21,9 @@ How to restrict table access to authenticated users, row level policies, and ema
|
||||
></iframe>
|
||||
</div>
|
||||
|
||||
### Gotrue Server
|
||||
### GoTrue Server
|
||||
|
||||
Gotrue is an auth API server written in Go by the Netlify team, find the Supabase fork here: https://github.com/supabase/gotrue. The list of available API endpoints is available [here](https://github.com/supabase/gotrue#endpoints).
|
||||
GoTrue is an auth API server written in Go by the Netlify team, find the Supabase fork [here](https://github.com/supabase/gotrue). The list of available API endpoints is available [here](https://github.com/supabase/gotrue#endpoints).
|
||||
|
||||
When you deploy a new Supabase project, we deploy a new instance of this server alongside your database, and also inject your database with the required `auth` schema.
|
||||
|
||||
@@ -40,19 +40,19 @@ curl -X POST 'https://<project-ref>.supabase.co/auth/v1/magiclink' \
|
||||
}'
|
||||
```
|
||||
|
||||
Gotrue is responsible for issuing access tokens for your users, sends confirmation, magic-link, and password recovery emails (by default we send these from a Supabase SMTP server, but you can easily plug in your own inside the dashboard at Project Settings > Auth) and also transacting with third party OAuth providers to get basic user data.
|
||||
GoTrue is responsible for issuing access tokens for your users, sends confirmation, magic-link, and password recovery emails (by default we send these from a Supabase SMTP server, but you can easily plug in your own inside the dashboard at Project Settings > Auth) and also transacting with third party OAuth providers to get basic user data.
|
||||
|
||||
The community even recently built in the functionality to request custom OAuth scopes, if your users need to interact more closely with the provider. See the scopes parameter here: [https://github.com/supabase/gotrue#get-authorize](https://github.com/supabase/gotrue#get-authorize).
|
||||
|
||||
So let's say you want to send emails on behalf of a user via gmail, you might request the gmail.send scope by directing them to:
|
||||
So let's say you want to send emails on behalf of a user via Gmail, you might request the gmail.send scope by directing them to:
|
||||
|
||||
```
|
||||
https://sjvwsaokcugktsdaxxze.supabase.co/auth/v1/authorize?provider=google&https://www.googleapis.com/auth/gmail.send
|
||||
```
|
||||
|
||||
You'll have to make sure your google app is verified of course in order to request these advanced scopes.
|
||||
You'll have to make sure your Google app is verified of course in order to request these advanced scopes.
|
||||
|
||||
[Gotrue-js](https://github.com/supabase/gotrue-js) (and also [gotrue-csharp](https://github.com/supabase/gotrue-csharp), [gotrue-py](https://github.com/j0/gotrue-py), [gotrue-kt](https://github.com/supabase/gotrue-kt), and [gotrue-dart](https://github.com/supabase/gotrue-dart)) are all wrappers around the gotrue API endpoints, and make for easier session management inside your client.
|
||||
[gotrue-js](https://github.com/supabase/gotrue-js) (and also [gotrue-csharp](https://github.com/supabase/gotrue-csharp), [gotrue-py](https://github.com/j0/gotrue-py), [gotrue-kt](https://github.com/supabase/gotrue-kt), and [gotrue-dart](https://github.com/supabase/gotrue-dart)) are all wrappers around the GoTrue API endpoints, and make for easier session management inside your client.
|
||||
|
||||
But all the functionality of gotrue-js is also available in supabase-js, which uses gotrue-js internally when you do things like:
|
||||
|
||||
@@ -65,7 +65,7 @@ const { user, session, error } = await supabase.auth.signInWithPassword({
|
||||
|
||||
If you want to request a feature, or contribute to the project directly, just head to https://github.com/supabase/gotrue and open some issues/PRs, we're always open to help.
|
||||
|
||||
In the next guide we'll be looking at how to setup external OAuth providers: Watch [Part Five: Google Oauth](../../learn/auth-deep-dive/auth-google-oauth)
|
||||
In the next guide we'll be looking at how to setup external OAuth providers: Watch [Part Five: Google OAuth](../../learn/auth-deep-dive/auth-google-oauth)
|
||||
|
||||
### Resources
|
||||
|
||||
@@ -77,7 +77,7 @@ In the next guide we'll be looking at how to setup external OAuth providers: Wat
|
||||
- Watch [Part Two: Row Level Security](../../learn/auth-deep-dive/auth-row-level-security)
|
||||
- Watch [Part Three: Policies](../../learn/auth-deep-dive/auth-policies)
|
||||
{/* <!-- Watch [Part Four: GoTrue](../../learn/auth-deep-dive/auth-gotrue) --> */}
|
||||
- Watch [Part Five: Google Oauth](../../learn/auth-deep-dive/auth-google-oauth)
|
||||
- Watch [Part Five: Google OAuth](../../learn/auth-deep-dive/auth-google-oauth)
|
||||
- Sign up for Supabase: [supabase.com/dashboard](https://supabase.com/dashboard)
|
||||
|
||||
export const Page = ({ children }) => <Layout meta={meta} children={children} />
|
||||
|
||||
Reference in new issue
Block a user