all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Damien Cassou <damien@cassou.me>
To: 36024@debbugs.gnu.org
Cc: "Julien Danjou" <julien@danjou.info>,
	"Rüdiger Sonderfeld" <ruediger@c-plusplus.de>
Subject: bug#36024: 26.2.50; [PATCH] Fix oauth2 to pass a type parameter when requesting authorization
Date: Fri, 31 May 2019 14:17:15 +0200	[thread overview]
Message-ID: <87d0jyrf78.fsf@cassou.me> (raw)

[-- Attachment #1: Type: text/plain, Size: 393 bytes --]

Hi,

it seems that oauth2 doesn't pass any type parameter when requesting
authorization even though it seems to be required by the spec. See the
patch for details.

I'm no expert so please double-check.

-- 
Damien Cassou
Företagsplatsen AB
Phone/Fax: +46 (0)8 774 63 00
Mobile: +33 (0)6 80 50 18 91
Address: Skeppsbron 26, 4tr, SE-111 30 Stockholm
Web: www.foretagsplatsen.se

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Fix-oauth2-to-pass-a-type-parameter-when-requesting-.patch --]
[-- Type: text/x-patch, Size: 1189 bytes --]

From a0d2132e5b3c8a47c4d2a2ec9d4233127ad0214c Mon Sep 17 00:00:00 2001
From: Damien Cassou <damien@cassou.me>
Date: Fri, 31 May 2019 14:07:46 +0200
Subject: [PATCH] Fix oauth2 to pass a type parameter when requesting
 authorization

* oauth2.el (oauth2-request-authorization): Add a "type=user_agent"
  parameter to the URL as it seems to be required by the protocol:
  https://tools.ietf.org/html/draft-ietf-oauth-v2-05#section-3.5.1
---
 oauth2.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/oauth2.el b/oauth2.el
index c8807f3..f6438ba 100644
--- a/oauth2.el
+++ b/oauth2.el
@@ -48,6 +48,7 @@ (defun oauth2-request-authorization (auth-url client-id &optional scope state re
                       (if (string-match-p "\?" auth-url) "&" "?")
                       "client_id=" (url-hexify-string client-id)
                       "&response_type=code"
+                      "&type=user_agent"
                       "&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)) "")))
-- 
2.21.0


             reply	other threads:[~2019-05-31 12:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-31 12:17 Damien Cassou [this message]
2019-05-31 13:27 ` bug#36024: 26.2.50; [PATCH] Fix oauth2 to pass a type parameter when requesting authorization Damien Cassou

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=87d0jyrf78.fsf@cassou.me \
    --to=damien@cassou.me \
    --cc=36024@debbugs.gnu.org \
    --cc=julien@danjou.info \
    --cc=ruediger@c-plusplus.de \
    /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.