From abfba4077f3947294543fee03d06699244fb5a5e Mon Sep 17 00:00:00 2001 From: Ste Vaidis Date: Sun, 15 Dec 2024 09:57:39 +0200 Subject: [PATCH] Update OAuth2.md --- OAuth2.md | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/OAuth2.md b/OAuth2.md index d342f74..01cbba2 100644 --- a/OAuth2.md +++ b/OAuth2.md @@ -76,4 +76,31 @@ code=4/0AX4XfWgNmGZVbV7Kdr8Q9yVyzIYBnbbBdLfX39ZaE8m0w8zT8jKRLl7w-uT8k7WiyLg0Q& redirect_uri=https://xorismesiti.gr/callback& client_id=YOUR_GOOGLE_CLIENT_ID& client_secret=YOUR_GOOGLE_CLIENT_SECRET -``` \ No newline at end of file +``` + +# 5. Access Token Response (Google Returns Tokens) + +Google validates the request + +and returns a response with the access token (which can be used to access the user's Google resources) + +and optionally, a refresh token (which can be used to refresh the access token when it expires). + +```json +{ + "access_token": "ya29.a0AfH6SMC8Op6zXZkHi2XITkDoOVzYXt3hTY6sny54UlWlxrnKlX5Xv78is7BEHekVX-VoA", + "token_type": "Bearer", + "expires_in": 3600, + "refresh_token": "1//04d5XHqmn6Hdy3wTf5OYDP1SyBa74zEFURjddQ2A1cFw78PY13pQyWhlD2A6XhDQtKlrjAqU4kS3vGdMvckw", + "scope": "email profile" +} +``` + +- HTTP Method: 200 OK +- Response Body: + - access_token: The access token used for accessing the user's resources (e.g., profile, email). + - token_type: Usually Bearer, indicating the type of token. + - expires_in: The lifetime of the access token in seconds (e.g., 3600 seconds = 1 hour). + - refresh_token: (Optional) The refresh token used to obtain a new access token when the current one expires. + - scope: The scope of access granted (e.g., email, profile). +