From 0d3e43e1f17241bd2e8a03fbfd8b6774b940478c Mon Sep 17 00:00:00 2001 From: Ste Vaidis Date: Wed, 8 Jan 2025 12:58:17 +0200 Subject: [PATCH] Update OAuth2.md --- OAuth2.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/OAuth2.md b/OAuth2.md index 6adcd21..3082f37 100644 --- a/OAuth2.md +++ b/OAuth2.md @@ -17,23 +17,23 @@ A way for the `user` to tell `google` to give an access to `myapp` app ### Details: -⭐️ 1. Get Authorization Code +#### ⭐️ 1. Get Authorization Code - 1. Frontend **Navigate** to Google URL with a callback url - 2. Google **Redirect** to Backend's callback url with the authorization code +1. Frontend **Navigate** to Google URL with a callback url +2. Google **Redirect** to Backend's callback url with the authorization code -⭐️ 2. Exchange Code with Token +#### ⭐️ 2. Exchange Code with 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 with the `access_token` in a `cookie` +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 with the `access_token` in a `cookie` -⭐️ 3. Use Token +#### ⭐️ 3. Use 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 +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