From 12c65d6cbb65bfb44d98f7e44352e9b48ca7d113 Mon Sep 17 00:00:00 2001 From: Ste Vaidis Date: Wed, 8 Jan 2025 10:07:03 +0200 Subject: [PATCH] Update OAuth2-Backend-Approach.md --- OAuth2-Backend-Approach.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/OAuth2-Backend-Approach.md b/OAuth2-Backend-Approach.md index d220a89..9e6efe9 100644 --- a/OAuth2-Backend-Approach.md +++ b/OAuth2-Backend-Approach.md @@ -24,14 +24,14 @@ A way for the `user` to tell `google` to give an access to `myapp` app 2. Exchange Code with Token - 1. Backend **POST** the `code` to Google `https://oauth2.googleapis.com/token` + 1. Backend **POST** the `code` to Google 2. Google **Response** to Backend with an `access_token` and a `refresh token` - 3. Backend **Redirect** to Frontend `https://myapp/auth/success` with the `access_token` in a `cookie` + 3. Backend **Redirect** to Frontend with the `access_token` in a `cookie` 3. Use Token - 1. Frontend **GET** profile data from Backend `https://myapp/api/auth/profile` using the `cookie` - 2. Backend **GET** profile data from Google `https://www.googleapis.com/oauth2/v3/userinfo` using the `access_token` + 1. Frontend **GET** profile data from Backend using the `cookie` + 2. Backend **GET** profile data from Google using the `access_token` 3. Google **Response** to Backend with profile data 4. Backend **Response** to Frontend with profile data