From 26ed9886bd9d3970d55cf76e4269cef3998503a7 Mon Sep 17 00:00:00 2001 From: Xiyue Deng Date: Sun, 21 Jul 2024 14:52:02 -0700 Subject: [PATCH 2/5] Add parameters required by Google OAuth2 to get refresh_token * packages/oauth2/oauth2.el (oauth2-request-authorization): add `access_type=offline' and `prompt=consent' when requesting token to receive refresh_token. --- oauth2.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/oauth2.el b/oauth2.el index 3a3e50ad2b..9780ac3a1d 100644 --- a/oauth2.el +++ b/oauth2.el @@ -63,7 +63,9 @@ It returns the code provided by the service." "&response_type=code" "&redirect_uri=" (url-hexify-string (or redirect-uri "urn:ietf:wg:oauth:2.0:oob")) (if scope (concat "&scope=" (url-hexify-string scope)) "") - (if state (concat "&state=" (url-hexify-string state)) "")))) + (if state (concat "&state=" (url-hexify-string state)) "") + "&access_type=offline" + "&prompt=consent"))) (browse-url url) (read-string (concat "Follow the instruction on your default browser, or " "visit:\n" url -- 2.39.2