tabi-memo / backend

0 stars 0 forks source link

Auth Design #4

Open samuraikun opened 8 months ago

samuraikun commented 8 months ago

Authentication/Authorization

Reason

Flow

sequenceDiagram
    participant User
    participant Next.js App (Vercel)
    participant Supabase Auth (OAuth)
    participant Cloud Run

    User->>Next.js App (Vercel): Enter Login Information
    Next.js App (Vercel)->>Supabase Auth (OAuth): Authenticate using Google Account
    Supabase Auth (OAuth)-->>Next.js App (Vercel): Authentication Token
    Next.js App (Vercel)->>Cloud Run: Request with Auth Token
    Cloud Run->>Supabase Auth (OAuth): Verify Token
    Supabase Auth (OAuth)-->>Cloud Run: Verification Result
    Cloud Run->>Next.js App (Vercel): Response
    Next.js App (Vercel)-->>User: Display Response
Yo-mah-Ya commented 8 months ago

@samuraikun Want some explicit comments where and how exactly we store user password just in case. And token as well.

samuraikun commented 8 months ago

@samuraikun Want some explicit comments where and how exactly we store user password just in case. And token as well.

Supabase supports most of the processes required for authentication. We don't need to manage passwords and tokens by ourselves. https://supabase.com/docs/guides/auth

Yo-mah-Ya commented 8 months ago

Great !