The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
Merge branch 'lw7/day-4' of https://github.com/supabase/supabase into lw7/day-4
Kang Ming0957626f5f9e
diff --cc apps/www/_blog/2023-04-13-supabase-auth-sso-pkce.mdxindex 176f3d1cea3,8ca6237fa72..d86be5f7a5a--- a/apps/www/_blog/2023-04-13-supabase-auth-sso-pkce.mdx+++ b/apps/www/_blog/2023-04-13-supabase-auth-sso-pkce.mdx@@@ -72,15 -72,19 +72,19 @@@ Many developers today are using Supabas### A brief history of Supabase Auth-When we [launched](https://news.ycombinator.com/item?id=24072051) Supabase Auth, our target was JAMstack developers. In these cases, the protocol used between the user’s application and Supabase Auth is known as the **\*\*\*\***\*\*\***\*\*\*\***[Implicit Grant Flow](https://www.rfc-editor.org/rfc/rfc6749#section-4.2):\*+When we [launched](https://news.ycombinator.com/item?id=24072051) Supabase Auth, our target was JAMstack developers. In these cases, the protocol used between the user's application and Supabase Auth is known as the **\*\*\*\***\*\*\***\*\*\*\***[Implicit Grant Flow](https://www.rfc-editor.org/rfc/rfc6749#section-4.2):\*- -- dark mode-- -- light mode+ <img+ className="dark:hidden !m-0"+ alt="diagram reference"+ src="/images/blog/launch-week-7/day-4-supabase-auth-sso-pkce/supabase-auth-implicit-grant-flow--light.svg"+ />++ <img+ className="hidden dark:block !m-0"+ alt="diagram reference"+ src="/images/blog/launch-week-7/day-4-supabase-auth-sso-pkce/supabase-auth-implicit-grant-flow--dark.svg"+ />As developers built more complex apps, they encountered two problems with this authentication flow:@@@ -97,21 -101,25 +101,25 @@@ Server-side auth unlocks a number of be### Introducing PKCE-To solve these problems, we’re introducing support for the _Proof Key for Code Exchange_ flow \*_(PKCE, pronounced “pixy”)_.\*+To solve these problems, we're introducing support for the _Proof Key for Code Exchange_ flow \*_(PKCE, pronounced “pixy”)_.\*-The PKCE flow introduces a _code verifier_ (a randomly generated secret) and a **\*\***\*\*\***\*\***code challenge (**\*\***\*\*\***\*\***the hash of the **_code verifier)._** The authorization code is returned as a query parameter so it’s accessible on the server. During the PKCE flow:+The PKCE flow introduces a _code verifier_ (a randomly generated secret) and a _code challenge_ (the hash of the _code verifier_). The authorization code is returned as a query parameter so it's accessible on the server. During the PKCE flow:1. The _code challenge_ is sent to Supabase Auth, which returns an _authorization code._-2. The client sends the _authorization code_ together with the _code verifier_ to obtain the user’s session.-3. Supabase Auth checks if the \***\*\*\*\*\*\*\***code verifier\***\*\*\*\*\*\*\*** matches the **\*\***\*\*\*\***\*\***code challenge**\*\***\*\*\*\***\*\*** sent earlier by computing the hash. This renders a malicious attacker’s attempt to intercept the authorization code useless, since they need to know the value of the _code verifier_ as well.+2. The client sends the _authorization code_ together with the _code verifier_ to obtain the user's session.+3. Supabase Auth checks if the _code verifier_ matches the _code challenge_ sent earlier by computing the hash. This renders a malicious attacker's attempt to intercept the authorization code useless, since they need to know the value of the _code verifier_ as well.- -- dark mode-- -- light mode+ <img+ className="dark:hidden !m-0"+ alt="diagram reference"+ src="/images/blog/launch-week-7/day-4-supabase-auth-sso-pkce/supabase-auth-pkce-flow--light.svg"+ />++ <img+ className="hidden dark:block !m-0"+ alt="diagram reference"+ src="/images/blog/launch-week-7/day-4-supabase-auth-sso-pkce/supabase-auth-pkce-flow--dark.svg"+ />### Migrating to PKCE on the client