all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Xu Chunyang <xuchunyang56@gmail.com>
To: 40228@debbugs.gnu.org
Cc: julien@danjou.info
Subject: bug#40228: [oauth2.el] oauth2-auth-and-store: Add optional argument state
Date: Thu, 26 Mar 2020 04:28:25 +0800	[thread overview]
Message-ID: <CABCqdB=_wAKHpRcovNOMukLGtY35i5135=AY+e2dUPOp_OdxZg@mail.gmail.com> (raw)

Hi,

I'm using an API which requires state, but oauth2-auth-and-store
doesn't take one, hence this package, by the way, I changed
resource-url to scope, the former looks like a typo.

diff -u --label /Users/xcy/.emacs.d/elpa-27.0.90/oauth2-0.11/oauth2.el
--label \#\<buffer\ oauth2.el\>
/Users/xcy/.emacs.d/elpa-27.0.90/oauth2-0.11/oauth2.el
/var/folders/7f/s191h4q97p90374yw15ssrs00000gn/T/buffer-content-9fSeJ8
--- /Users/xcy/.emacs.d/elpa-27.0.90/oauth2-0.11/oauth2.el
+++ #<buffer oauth2.el>
@@ -149,7 +149,7 @@
   (secure-hash 'md5 (concat auth-url token-url resource-url)))

 ;;;###autoload
-(defun oauth2-auth-and-store (auth-url token-url resource-url
client-id client-secret &optional redirect-uri)
+(defun oauth2-auth-and-store (auth-url token-url scope client-id
client-secret &optional redirect-uri state)
   "Request access to a resource and store it using `plstore'."
   ;; We store a MD5 sum of all URL
   (let* ((plstore (plstore-open oauth2-token-file))
@@ -167,7 +167,7 @@
                            :token-url token-url
                            :access-response (plist-get plist :access-response))
       (let ((token (oauth2-auth auth-url token-url
-                                client-id client-secret resource-url
nil redirect-uri)))
+                                client-id client-secret scope state
redirect-uri)))
         ;; Set the plstore
         (setf (oauth2-token-plstore token) plstore)
         (setf (oauth2-token-plstore-id token) id)

Diff finished.  Thu Mar 26 04:23:21 2020





             reply	other threads:[~2020-03-25 20:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-25 20:28 Xu Chunyang [this message]
2020-03-25 20:32 ` bug#40228: [oauth2.el] oauth2-auth-and-store: Add optional argument state Xu Chunyang
2020-10-01 18:30   ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CABCqdB=_wAKHpRcovNOMukLGtY35i5135=AY+e2dUPOp_OdxZg@mail.gmail.com' \
    --to=xuchunyang56@gmail.com \
    --cc=40228@debbugs.gnu.org \
    --cc=julien@danjou.info \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.