From d95cde6209ae1530cc5c835bb27ce27e6d6e91f8 Mon Sep 17 00:00:00 2001 From: Mateo Morris Date: Sun, 7 Mar 2021 11:33:07 +0200 Subject: [PATCH 1/4] Add 'scopes' documentation --- web/spec/supabase.yml | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/web/spec/supabase.yml b/web/spec/supabase.yml index f693209fe58..14d64ff8c34 100644 --- a/web/spec/supabase.yml +++ b/web/spec/supabase.yml @@ -255,6 +255,22 @@ pages: ```py # Not yet implemented ``` + - name: Sign up with scopes. + description: | + If you need more than just an email address from an OAuth provider (e.g. access to a user's Github repos), you can include additional + scopes as a space-seperated string. Depending on the provider, you may also need to specify the scopes in the provider's OAuth app settings. + js: | + ```js + const { user, session, error } = await supabase.auth.signIn({ + provider: 'github' + }, { + scopes: 'repo gist notifications' + }) + ``` + py: | + ```py + # Not yet implemented + ``` auth.signIn(): $ref: '@supabase/gotrue-js."GoTrueClient".GoTrueClient.signIn' @@ -304,7 +320,7 @@ pages: ``` - name: Sign in with redirect. description: | - Sometime you want to control where the user is redirected to after they are logged in. Supabase supports this for + Sometimes you want to control where the user is redirected to after they are logged in. Supabase supports this for any URL path on your website (the base domain must be the same as the domain in your Auth settings). js: | ```js @@ -318,6 +334,22 @@ pages: ```py # Not yet implemented ``` + - name: Sign in with scopes. + description: | + If you need more than just an email address from an OAuth provider (e.g. access to a user's Github repos), you can include additional + scopes as a space-seperated string. Depending on the provider, you may also need to specify the scopes in the provider's OAuth app settings. + js: | + ```js + const { user, session, error } = await supabase.auth.signIn({ + provider: 'github' + }, { + scopes: 'repo gist notifications' + }) + ``` + py: | + ```py + # Not yet implemented + ``` auth.signOut(): $ref: '@supabase/gotrue-js."GoTrueClient".GoTrueClient.signOut' From d8faf86712e1eddd229d5d5f4d79a48503fa2d8b Mon Sep 17 00:00:00 2001 From: Mateo Morris Date: Sun, 7 Mar 2021 11:33:07 +0200 Subject: [PATCH 2/4] Add 'scopes' documentation --- web/spec/supabase.yml | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/web/spec/supabase.yml b/web/spec/supabase.yml index 694bc63c6c9..5d70cb8e988 100644 --- a/web/spec/supabase.yml +++ b/web/spec/supabase.yml @@ -255,6 +255,22 @@ pages: ```py # Not yet implemented ``` + - name: Sign up with scopes. + description: | + If you need more than just an email address from an OAuth provider (e.g. access to a user's Github repos), you can include additional + scopes as a space-seperated string. Depending on the provider, you may also need to specify the scopes in the provider's OAuth app settings. + js: | + ```js + const { user, session, error } = await supabase.auth.signIn({ + provider: 'github' + }, { + scopes: 'repo gist notifications' + }) + ``` + py: | + ```py + # Not yet implemented + ``` auth.signIn(): $ref: '@supabase/gotrue-js."GoTrueClient".GoTrueClient.signIn' @@ -304,7 +320,7 @@ pages: ``` - name: Sign in with redirect. description: | - Sometime you want to control where the user is redirected to after they are logged in. Supabase supports this for + Sometimes you want to control where the user is redirected to after they are logged in. Supabase supports this for any URL path on your website (the base domain must be the same as the domain in your Auth settings). js: | ```js @@ -318,6 +334,22 @@ pages: ```py # Not yet implemented ``` + - name: Sign in with scopes. + description: | + If you need more than just an email address from an OAuth provider (e.g. access to a user's Github repos), you can include additional + scopes as a space-seperated string. Depending on the provider, you may also need to specify the scopes in the provider's OAuth app settings. + js: | + ```js + const { user, session, error } = await supabase.auth.signIn({ + provider: 'github' + }, { + scopes: 'repo gist notifications' + }) + ``` + py: | + ```py + # Not yet implemented + ``` auth.signOut(): $ref: '@supabase/gotrue-js."GoTrueClient".GoTrueClient.signOut' From 86fdf66e4d7e204198f7863a72d8df89e05ad852 Mon Sep 17 00:00:00 2001 From: Mateo Morris Date: Wed, 10 Mar 2021 10:58:51 +0200 Subject: [PATCH 3/4] improve 'scopes' documentation --- web/spec/supabase.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/web/spec/supabase.yml b/web/spec/supabase.yml index 5d70cb8e988..11febbbf335 100644 --- a/web/spec/supabase.yml +++ b/web/spec/supabase.yml @@ -257,8 +257,8 @@ pages: ``` - name: Sign up with scopes. description: | - If you need more than just an email address from an OAuth provider (e.g. access to a user's Github repos), you can include additional - scopes as a space-seperated string. Depending on the provider, you may also need to specify the scopes in the provider's OAuth app settings. + If you need additional data from an OAuth provider, you can include a space-separated list of scopes in your request. + You may also need to specify the scopes in the provider's OAuth app settings, depending on the provider. js: | ```js const { user, session, error } = await supabase.auth.signIn({ @@ -266,6 +266,7 @@ pages: }, { scopes: 'repo gist notifications' }) + const oAuthToken = session.provider_token // use to access provider API ``` py: | ```py @@ -336,8 +337,8 @@ pages: ``` - name: Sign in with scopes. description: | - If you need more than just an email address from an OAuth provider (e.g. access to a user's Github repos), you can include additional - scopes as a space-seperated string. Depending on the provider, you may also need to specify the scopes in the provider's OAuth app settings. + If you need additional data from an OAuth provider, you can include a space-separated list of scopes in your request. + You may also need to specify the scopes in the provider's OAuth app settings, depending on the provider. js: | ```js const { user, session, error } = await supabase.auth.signIn({ @@ -345,6 +346,7 @@ pages: }, { scopes: 'repo gist notifications' }) + const oAuthToken = session.provider_token // use to access provider API ``` py: | ```py From d67145c76d8edac3bbb0958610bbf7a1e2de86fe Mon Sep 17 00:00:00 2001 From: Mateo Morris Date: Wed, 10 Mar 2021 11:37:54 +0200 Subject: [PATCH 4/4] Clarify provider token in docs --- web/spec/supabase.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/spec/supabase.yml b/web/spec/supabase.yml index 11febbbf335..a5a240e6d68 100644 --- a/web/spec/supabase.yml +++ b/web/spec/supabase.yml @@ -257,7 +257,7 @@ pages: ``` - name: Sign up with scopes. description: | - If you need additional data from an OAuth provider, you can include a space-separated list of scopes in your request. + If you need additional data from an OAuth provider, you can include a space-separated list of scopes in your request to get back an OAuth provider token. You may also need to specify the scopes in the provider's OAuth app settings, depending on the provider. js: | ```js @@ -337,7 +337,7 @@ pages: ``` - name: Sign in with scopes. description: | - If you need additional data from an OAuth provider, you can include a space-separated list of scopes in your request. + If you need additional data from an OAuth provider, you can include a space-separated list of scopes in your request to get back an OAuth provider token. You may also need to specify the scopes in the provider's OAuth app settings, depending on the provider. js: | ```js