Subject: 26.2.50; [PATCH] Fix oauth2 to pass a type parameter when requesting authorization

From: Damien Cassou <[email-masked]>
Date: Fri, 31 May 2019 14:17:15 +0200

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
>From a0d2132e5b3c8a47c4d2a2ec9d4233127ad0214c Mon Sep 17 00:00:00 2001
From: Damien Cassou <[email-masked]>
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