Skip to content

Instantly share code, notes, and snippets.

@yoshinari-nomura
Created April 11, 2023 03:25
Show Gist options
  • Save yoshinari-nomura/cfea891145cfaf469268dde805f55e92 to your computer and use it in GitHub Desktop.
Save yoshinari-nomura/cfea891145cfaf469268dde805f55e92 to your computer and use it in GitHub Desktop.
Dirty hack to make oauth2.el work with OOB-disabled providers
--- 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