Created
April 11, 2023 03:25
-
-
Save yoshinari-nomura/cfea891145cfaf469268dde805f55e92 to your computer and use it in GitHub Desktop.
Dirty hack to make oauth2.el work with OOB-disabled providers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- oauth2.el.orig 2022-12-21 05:13:00.000000000 +0900 | |
+++ oauth2.el 2023-04-11 11:40:27.494107486 +0900 | |
@@ -61,7 +61,7 @@ | |
(if (string-match-p "\?" auth-url) "&" "?") | |
"client_id=" (url-hexify-string client-id) | |
"&response_type=code" | |
- "&redirect_uri=" (url-hexify-string (or redirect-uri "urn:ietf:wg:oauth:2.0:oob")) | |
+ "&redirect_uri=" (url-hexify-string (or redirect-uri "http://localhost:1/")) | |
(if scope (concat "&scope=" (url-hexify-string scope)) "") | |
(if state (concat "&state=" (url-hexify-string state)) ""))) | |
(read-string "Enter the code your browser displayed: ")) | |
@@ -106,7 +106,7 @@ | |
(when client-secret | |
(concat "&client_secret=" client-secret)) | |
"&code=" code | |
- "&redirect_uri=" (url-hexify-string (or redirect-uri "urn:ietf:wg:oauth:2.0:oob")) | |
+ "&redirect_uri=" (url-hexify-string (or redirect-uri "http://localhost:1/")) | |
"&grant_type=authorization_code")))) | |
(make-oauth2-token :client-id client-id | |
:client-secret client-secret |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Original awesome hack:
https://stackoverflow.com/questions/71318804/google-oauth-2-0-failing-with-error-400-invalid-request-for-some-client-id-but/71331562#71331562