diff --git a/OAuth2.md b/OAuth2.md index fcd86b6..755fd6d 100644 --- a/OAuth2.md +++ b/OAuth2.md @@ -190,17 +190,6 @@ export default Callback;

Backend HTTP POST Request to Google

-- `HTTP` Method: POST -- `URL`: https://oauth2.googleapis.com/token -- `Headers`: - - `Content`-Type: application/x-www-form-urlencoded -- `Body` Parameters: - - `grant_type`=authorization_code: This specifies the grant type. - - `code`: The authorization code you received in the previous step. - - `redirect_uri`: The same redirect URI used in the authorization request. - - `client_id`: Your Google API client ID. - - `client_secret`: Your Google API client secret (which should be kept secure). - ```sh POST https://oauth2.googleapis.com/token Content-Type: application/x-www-form-urlencoded @@ -212,6 +201,17 @@ client_id=ABC34JHS9D& client_secret=PASS1234 ``` +- `HTTP Method`: POST +- `URL`: https://oauth2.googleapis.com/token +- Headers + - `Content-Type`: application/x-www-form-urlencoded +- Body + - `grant_type`=authorization_code: This specifies the grant type. + - `code`: The authorization code you received in the previous step. + - `redirect_uri`: The same redirect URI used in the authorization request. + - `client_id`: Your Google API client ID. + - `client_secret`: Your Google API client secret (which should be kept secure). +
@@ -285,9 +285,11 @@ app.listen(3000, () => { # 4. [Frontend] Use the Token -Once the backend exchanges the `code` for the `access_token`, +Once the backend exchanges the `code` for the `access_token`, -the frontend can use it to make authenticated requests to the backend or Google APIs +incude these tokens to POST reponse recieved from frontend, + +so that the frontend can use it to make authenticated requests to the backend or Google APIs

Frontend HTTP GET Request to Backend