From sachinmamoru@gmail.com  Mon Feb 19 22:44:25 2024
Return-Path: <sachinmamoru@gmail.com>
X-Original-To: oauth@ietfa.amsl.com
Delivered-To: oauth@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1])
 by ietfa.amsl.com (Postfix) with ESMTP id D51BEC14F6F0
 for <oauth@ietfa.amsl.com>; Mon, 19 Feb 2024 22:44:25 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.084
X-Spam-Level: 
X-Spam-Status: No, score=-2.084 tagged_above=-999 required=5
 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
 DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001,
 HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001,
 RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001, T_KAM_HTML_FONT_INVALID=0.01, T_REMOTE_IMAGE=0.01,
 T_SCC_BODY_TEXT_LINE=-0.01, URIBL_BLOCKED=0.001,
 URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001]
 autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key)
 header.d=gmail.com
Received: from mail.ietf.org ([50.223.129.194])
 by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id cGD64j_-zshb for <oauth@ietfa.amsl.com>;
 Mon, 19 Feb 2024 22:44:21 -0800 (PST)
Received: from mail-yw1-x112a.google.com (mail-yw1-x112a.google.com
 [IPv6:2607:f8b0:4864:20::112a])
 (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256)
 (No client certificate requested)
 by ietfa.amsl.com (Postfix) with ESMTPS id 727BAC14F69E
 for <oauth@ietf.org>; Mon, 19 Feb 2024 22:44:21 -0800 (PST)
Received: by mail-yw1-x112a.google.com with SMTP id
 00721157ae682-6081bc96387so18830227b3.0
 for <oauth@ietf.org>; Mon, 19 Feb 2024 22:44:21 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1708411460; x=1709016260; darn=ietf.org;
 h=to:subject:message-id:date:from:mime-version:from:to:cc:subject
 :date:message-id:reply-to;
 bh=hDAC+sTE3co8OwgW2OzDiuEeJ8j0yYpEtgeYqhkLmwQ=;
 b=gFUZtwLF5uowgp9hSMSFPFvJklcaAtfqwpr0jymOO6DQ/0H/KUaV2oddpTAbZfnXyv
 aY3FG7QYdwVOlxQiZT/lECCU6xy2uh66vrA7OFJO8cVXpjaoVJCLcviT1fyg5unQD9v0
 7exV6ZMklqF9Ian8RfnBlzbhgB49xBM7kH+qt8ty2RQ1ChGH22qF7Y1N5jpUFm9Pntbf
 AsqlOICeggrGeO7C2UNG7qfYl+4SnBQjvNd+GtzgB4zaUW/OXyKU27Lo0QEHBOH7v83K
 n4KUT2kiz2V27hcR6HG87dlbsZdlv48E5z42wB2ObZKWA4hRQdkFzYVPnA53Ory+js/2
 TgyQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1708411460; x=1709016260;
 h=to:subject:message-id:date:from:mime-version:x-gm-message-state
 :from:to:cc:subject:date:message-id:reply-to;
 bh=hDAC+sTE3co8OwgW2OzDiuEeJ8j0yYpEtgeYqhkLmwQ=;
 b=j1E/E7AMh3ifdBKTSmAwkZ0q0keXz76aR6ZS5feTzqczZl6tFldxj74HN/ZUUwfm95
 Ld3inV/db10siH/Y5G5/FNzKZg6rC0CelSPB10N1sleTJrUzmVnTw5gaN5fN2X6uD+1z
 F5UR6MgBT9dtbiZKwTDDRkcfhCXAqWRdgcb68ef3Z/PYhISd00gktVHkR0pkL3DSjJFI
 2M8Tv2UQwaZtU7CwpXwIvOk+xhnn69/Op80DjnPTBpHPs1Bu/JwdlryAKJVjOGku7Ou8
 blE0y6itX9bN0du+jqPt8efoIQvwb69Yzam407IhiwgmKCqGgyUvJBEIDlphAiYzxdjB
 pA+Q==
X-Gm-Message-State: AOJu0Yz/y0f5wiWcRbsjmqyviG+gkMqaUWAQg7u2Cb/ErGi+LEoI8Otn
 twt481o3ntgIRINvQQhBy6oi2mUzbGzmSYWXXKH/41QwIpoOpT46fOi5xeL3Q6g79Krz0rHdlbV
 OAIOxAfFFLQN+V6pNXB94IHzzuxtnx2/2BOyJQ1XC
X-Google-Smtp-Source: AGHT+IHswqeBUAbE9j9WTvFpcFmSj8d1X1YjXG4n+Sh6WxLA7m6TwWuBdoIUTNsHIuRzeekBvkM/Uhwf5G+SOjliTGY=
X-Received: by 2002:a5b:5c2:0:b0:dc6:1869:9919 with SMTP id
 w2-20020a5b05c2000000b00dc618699919mr14552615ybp.41.1708411459931; Mon, 19
 Feb 2024 22:44:19 -0800 (PST)
MIME-Version: 1.0
From: Sachin Mamoru <sachinmamoru@gmail.com>
Date: Tue, 20 Feb 2024 12:14:08 +0530
Message-ID: <CAD=XBCqr61N_4rz4GVD_19QUO+q3LrzeO-iQ7MGCUx7fMVxy=Q@mail.gmail.com>
To: oauth@ietf.org
Content-Type: multipart/alternative; boundary="0000000000003310a00611ca8a8c"
Archived-At: <https://mailarchive.ietf.org/arch/msg/oauth/-oWiWDtq8Vh0KyG-NF_QkwBb5e8>
Subject: [OAUTH-WG] Evaluation of Scope Management in Refresh Token Behavior
X-BeenThere: oauth@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: OAUTH WG <oauth.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/oauth>,
 <mailto:oauth-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/oauth/>
List-Post: <mailto:oauth@ietf.org>
List-Help: <mailto:oauth-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/oauth>,
 <mailto:oauth-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 20 Feb 2024 06:44:25 -0000

--0000000000003310a00611ca8a8c
Content-Type: text/plain; charset="UTF-8"

Hi All,

When we request an access token using 3 scopes (scope1, scope2, scope3).

Then will receive a refresh token (refresh_token1) with the access token.

After that will request another access token with refresh_token1 and
provide the scope list as scope1 and scope2 (Narrow down scopes).

Similarly, get another refresh token (refresh_token2) with the access token.

Now if we request another access token with refresh_token2, we cannot
request scope3, instead, we can either request both scope1 and scope2 or
one of them.

But in the specification, didn't able to find anything related to
narrow-down scopes with refresh token.

>From Spec

1.5.  Refresh Token - Refresh tokens are issued to the client by the
authorization server and are used to obtain a new access token when the
current access token becomes invalid or expires or to obtain additional
access tokens with identical or narrower scope (access tokens may have a
shorter lifetime and fewer permissions than authorized by the resource
owner).

6.  Refreshing an Access Token

The scope of the access request as described by Section 3.3.  The requested
scope MUST NOT include any scope not originally granted by the resource
owner, and if omitted is treated as equal to the scope originally granted
by the resource owner.

https://datatracker.ietf.org/doc/html/rfc6749


IMO, from a security aspect, the current behaviour is much more secure
because it is designed to maintain the principle of least privilege, where
it updates the refresh token authorised scopes based on the requested ones.


What should be the correct behaviour?
narrow-down scope refresh token should also be able to request access token
with original scope list?


Your input is highly valuable on this.


Thanks & Regards,
Sachin
-- 

Sachin Mamoru
Software Engineer, WSO2
+94771292681
| sachinmamoru.me  <https://sachinmamoru.me>
sachinmamoru@gmail.com  <sachinmamoru@gmail.com>
<https://www.linkedin.com/in/sachin-mamoru/>
<https://twitter.com/MamoruSachin>

--0000000000003310a00611ca8a8c
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hi All,<div><br></div><div><p dir=3D"ltr" style=3D"line-he=
ight:1.2;margin-top:0pt;margin-bottom:0pt"><span style=3D"color:rgb(0,0,0);=
background-color:transparent;font-variant-numeric:normal;font-variant-east-=
asian:normal;font-variant-alternates:normal;vertical-align:baseline"><font =
face=3D"arial, sans-serif">When we request an access token using 3 scopes (=
scope1, scope2, scope3).</font></span></p><p dir=3D"ltr" style=3D"line-heig=
ht:1.2;margin-top:0pt;margin-bottom:0pt"><span style=3D"color:rgb(0,0,0);ba=
ckground-color:transparent;font-variant-numeric:normal;font-variant-east-as=
ian:normal;font-variant-alternates:normal;vertical-align:baseline"><font fa=
ce=3D"arial, sans-serif">Then will receive a refresh token (refresh_token1)=
 with the access token.</font></span></p><font face=3D"arial, sans-serif"><=
br></font><p dir=3D"ltr" style=3D"line-height:1.2;margin-top:0pt;margin-bot=
tom:0pt"><span style=3D"color:rgb(0,0,0);background-color:transparent;font-=
variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternat=
es:normal;vertical-align:baseline"><font face=3D"arial, sans-serif">After t=
hat will request another access token with refresh_token1 and provide the s=
cope list as scope1 and scope2 (Narrow down scopes).</font></span></p><p di=
r=3D"ltr" style=3D"line-height:1.2;margin-top:0pt;margin-bottom:0pt"><span =
style=3D"color:rgb(0,0,0);background-color:transparent;font-variant-numeric=
:normal;font-variant-east-asian:normal;font-variant-alternates:normal;verti=
cal-align:baseline"><font face=3D"arial, sans-serif">Similarly, get another=
 refresh token (refresh_token2) with the access token.</font></span></p><fo=
nt face=3D"arial, sans-serif"><br></font><p dir=3D"ltr" style=3D"line-heigh=
t:1.2;margin-top:0pt;margin-bottom:0pt"><span style=3D"color:rgb(0,0,0);bac=
kground-color:transparent;font-variant-numeric:normal;font-variant-east-asi=
an:normal;font-variant-alternates:normal;vertical-align:baseline"><font fac=
e=3D"arial, sans-serif">Now if we request another access token with refresh=
_token2, we cannot request scope3, instead, we can either request both scop=
e1 and scope2 or one of them.<br></font></span></p><font face=3D"arial, san=
s-serif"><br></font><p dir=3D"ltr" style=3D"line-height:1.2;margin-top:0pt;=
margin-bottom:0pt"><span style=3D"color:rgb(0,0,0);background-color:transpa=
rent;font-variant-numeric:normal;font-variant-east-asian:normal;font-varian=
t-alternates:normal;vertical-align:baseline"><font face=3D"arial, sans-seri=
f">But in the specification, didn&#39;t able to find anything related to na=
rrow-down scopes with refresh token.</font></span></p><font face=3D"arial, =
sans-serif"><br></font><p dir=3D"ltr" style=3D"line-height:1.2;margin-top:0=
pt;margin-bottom:0pt"><span style=3D"color:rgb(0,0,0);background-color:tran=
sparent;font-variant-numeric:normal;font-variant-east-asian:normal;font-var=
iant-alternates:normal;text-decoration-line:underline;vertical-align:baseli=
ne"><font face=3D"arial, sans-serif">From Spec</font></span></p><font face=
=3D"arial, sans-serif"><br></font><p dir=3D"ltr" style=3D"line-height:1.2;m=
argin-top:0pt;margin-bottom:0pt"><font face=3D"arial, sans-serif"><span sty=
le=3D"color:rgb(0,0,0);background-color:transparent;font-variant-numeric:no=
rmal;font-variant-east-asian:normal;font-variant-alternates:normal;vertical=
-align:baseline">1.5.=C2=A0 Refresh Token -=C2=A0</span><span style=3D"back=
ground-color:transparent;color:rgb(0,0,0)">Refresh tokens are issued to the=
 client by the authorization server and are=C2=A0</span><span style=3D"back=
ground-color:transparent;color:rgb(0,0,0)">used to obtain a new access toke=
n when the current access token=C2=A0</span><span style=3D"background-color=
:transparent;color:rgb(0,0,0)">becomes invalid or expires or to obtain addi=
tional access tokens=C2=A0</span><span style=3D"background-color:transparen=
t;color:rgb(0,0,0)">with identical or narrower scope (access tokens may hav=
e a shorter=C2=A0</span><span style=3D"background-color:transparent;color:r=
gb(0,0,0)">lifetime and fewer permissions than authorized by the resource=
=C2=A0</span><span style=3D"background-color:transparent;color:rgb(0,0,0)">=
owner).</span></font></p><font face=3D"arial, sans-serif"><br></font><p dir=
=3D"ltr" style=3D"line-height:1.2;margin-top:0pt;margin-bottom:0pt"><span s=
tyle=3D"color:rgb(0,0,0);background-color:transparent;font-variant-numeric:=
normal;font-variant-east-asian:normal;font-variant-alternates:normal;vertic=
al-align:baseline"><font face=3D"arial, sans-serif">6.=C2=A0 Refreshing an =
Access Token</font></span></p><p dir=3D"ltr" style=3D"line-height:1.2;margi=
n-top:0pt;margin-bottom:0pt"><font face=3D"arial, sans-serif"><span style=
=3D"color:rgb(0,0,0);background-color:transparent;font-variant-numeric:norm=
al;font-variant-east-asian:normal;font-variant-alternates:normal;vertical-a=
lign:baseline">The scope of the access request as described by=C2=A0</span>=
<span style=3D"background-color:transparent;color:rgb(0,0,0)">Section 3.3.=
=C2=A0 The requested scope MUST NOT include any scope=C2=A0</span><span sty=
le=3D"background-color:transparent;color:rgb(0,0,0)">not originally granted=
 by the resource owner, and if omitted is=C2=A0</span><span style=3D"backgr=
ound-color:transparent;color:rgb(0,0,0)">treated as equal to the scope orig=
inally granted by the=C2=A0</span><span style=3D"background-color:transpare=
nt;color:rgb(0,0,0)">resource owner.</span></font></p><font face=3D"arial, =
sans-serif"><br></font><p dir=3D"ltr" style=3D"line-height:1.2;margin-top:0=
pt;margin-bottom:0pt"><a href=3D"https://datatracker.ietf.org/doc/html/rfc6=
749" target=3D"_blank" style=3D"text-decoration-line:none"><span style=3D"b=
ackground-color:transparent;font-variant-numeric:normal;font-variant-east-a=
sian:normal;font-variant-alternates:normal;text-decoration-line:underline;v=
ertical-align:baseline"><font face=3D"arial, sans-serif">https://datatracke=
r.ietf.org/doc/html/rfc6749</font></span></a></p><p dir=3D"ltr" style=3D"li=
ne-height:1.2;margin-top:0pt;margin-bottom:0pt"><font face=3D"arial, sans-s=
erif"><br></font></p><p dir=3D"ltr" style=3D"line-height:1.2;margin-top:0pt=
;margin-bottom:0pt"><font face=3D"arial, sans-serif">IMO, from a security a=
spect, the current behaviour is much more secure because it is designed to =
maintain the principle of least privilege, where it updates the refresh tok=
en authorised scopes based on the requested ones.</font></p><p dir=3D"ltr" =
style=3D"line-height:1.2;margin-top:0pt;margin-bottom:0pt"><br></p><p dir=
=3D"ltr" style=3D"line-height:1.2;margin-top:0pt;margin-bottom:0pt">What sh=
ould be the correct behaviour?<br>narrow-down scope refresh token should al=
so be able to request access token with original scope list?<font face=3D"a=
rial, sans-serif"><br></font></p><p dir=3D"ltr" style=3D"line-height:1.2;ma=
rgin-top:0pt;margin-bottom:0pt"><br></p><p dir=3D"ltr" style=3D"line-height=
:1.2;margin-top:0pt;margin-bottom:0pt">Your input is highly valuable on thi=
s.</p><p dir=3D"ltr" style=3D"line-height:1.2;margin-top:0pt;margin-bottom:=
0pt"><br>Thanks &amp; Regards,<br>Sachin</p></div><span class=3D"gmail_sign=
ature_prefix">-- </span><br><div dir=3D"ltr" class=3D"gmail_signature" data=
-smartmail=3D"gmail_signature"><div dir=3D"ltr"><div dir=3D"ltr"><table sty=
le=3D"direction:ltr;border-collapse:collapse"><tbody><tr><td style=3D"font-=
size:0;height:12px;line-height:0"></td></tr><tr><td><table cellpadding=3D"0=
" cellspacing=3D"0" style=3D"border-collapse:collapse;font-family:Arial;lin=
e-height:1.15;color:#000"><tbody><tr><td style=3D"vertical-align:top;paddin=
g:.01px 14px 0.01px 0.01px"><table cellpadding=3D"0" cellspacing=3D"0" styl=
e=3D"border-collapse:collapse;width:65px"><tbody><tr><td style=3D"padding:.=
01px 10px 0 0"><img src=3D"https://d36urhup7zbd7q.cloudfront.net/29e6c216-f=
94e-4bc3-8205-f3ea762db0d5/profile.format_png.resize_200x.jpeg" height=3D"a=
uto" width=3D"65" style=3D"width:65px;vertical-align:initial;border-radius:=
0;display:block;height:autopx"></td></tr></tbody></table></td><td height=3D=
"1" width=3D"0" style=3D"width:0;padding:.01px;border-right:1px solid #bdbd=
bd;height:1px;font-size:1pt">=C2=A0</td><td style=3D"padding:.01px 0.01px 0=
.01px 14px;vertical-align:top" valign=3D"top"><table cellpadding=3D"0" cell=
spacing=3D"0" style=3D"border-collapse:collapse"><tbody><tr><td style=3D"li=
ne-height:1.2;padding:.01px 0.01px 12px 0.01px"><span style=3D"font-family:=
Arial;text-transform:initial;font-weight:bold"><span style=3D"color:#646464=
;font-size:16px"> Sachin Mamoru </span></span><br><span style=3D"font-size:=
13px;letter-spacing:0;font-family:Arial;text-transform:initial;font-weight:=
bold;color:#646464"> Software Engineer, </span> <span style=3D"font-size:13=
px;letter-spacing:0;font-family:Arial;text-transform:initial;font-weight:bo=
ld;color:#646464"> WSO2</span></td></tr><tr><td style=3D"padding:.01px;line=
-height:0"><table cellpadding=3D"0" cellspacing=3D"0" style=3D"border-colla=
pse:collapse"><tbody><tr><td style=3D"padding:.01px"><table cellpadding=3D"=
0" cellspacing=3D"0" style=3D"border-collapse:collapse"><tbody><tr><td styl=
e=3D"line-height:0;padding:.01px 0.01px 6px 0.01px"><table cellpadding=3D"0=
" cellspacing=3D"0" style=3D"border-collapse:collapse;line-height:14px;font=
-size:12px;font-family:Arial"><tbody><tr><td style=3D"padding:.01px;font-fa=
mily:Arial;font-size:12px"><a href=3D"tel:+94771292681" style=3D"text-decor=
ation:unset;font-size:12px;font-family:Arial" target=3D"_blank"><span style=
=3D"line-height:1.2;color:#212121;font-family:Arial;white-space:nowrap;font=
-size:12px"> +94771292681</span></a></td></tr></tbody></table></td><td styl=
e=3D"line-height:0;padding:.01px 0.01px 6px 0.01px"><table cellpadding=3D"0=
" cellspacing=3D"0" style=3D"border-collapse:collapse;line-height:14px;font=
-size:12px;font-family:Arial"><tbody><tr><td style=3D"padding:0 4px"><span =
style=3D"font-family:Arial;font-weight:bold;font-size:12px;color:#212121;ve=
rtical-align:2px"> | </span></td><td style=3D"padding:.01px;font-family:Ari=
al;font-size:12px"><a href=3D"https://sachinmamoru.me" style=3D"text-decora=
tion:unset;font-size:12px;font-family:Arial" target=3D"_blank"><span style=
=3D"line-height:1.2;color:#212121;font-family:Arial;white-space:nowrap;font=
-size:12px"> sachinmamoru.me=C2=A0</span></a></td></tr></tbody></table></td=
></tr></tbody></table></td></tr><tr><td style=3D"padding:.01px"><table cell=
padding=3D"0" cellspacing=3D"0" style=3D"border-collapse:collapse"><tbody><=
tr><td style=3D"line-height:0;padding:.01px 0.01px 6px 0.01px"><table cellp=
adding=3D"0" cellspacing=3D"0" style=3D"border-collapse:collapse;line-heigh=
t:14px;font-size:12px;font-family:Arial"><tbody><tr><td style=3D"padding:.0=
1px;font-family:Arial;font-size:12px"><a href=3D"mailto:sachinmamoru@gmail.=
com" style=3D"text-decoration:unset;font-size:12px;font-family:Arial" targe=
t=3D"_blank"><span style=3D"line-height:1.2;color:#212121;font-family:Arial=
;white-space:nowrap;font-size:12px"> sachinmamoru@gmail.com=C2=A0</span></a=
></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></ta=
ble></td></tr><tr><td style=3D"padding:12px 0.01px 0.01px 0.01px"><table ce=
llpadding=3D"0" cellspacing=3D"0" style=3D"border-collapse:collapse;width:1=
00%"><tbody><tr><td style=3D"padding:.01px"><table border=3D"0" cellpadding=
=3D"0" cellspacing=3D"0"><tbody><tr><td align=3D"left" style=3D"padding-rig=
ht:6px;text-align:center;padding-top:0"><a href=3D"https://www.linkedin.com=
/in/sachin-mamoru/" target=3D"_blank"><img width=3D"25" height=3D"25" src=
=3D"https://cdn.gifo.wisestamp.com/s/ld/0077b5/50/0/background.png" style=
=3D"float:left;border:none" border=3D"0"></a></td><td align=3D"left" style=
=3D"padding-right:6px;text-align:center;padding-top:0"><a href=3D"https://t=
witter.com/MamoruSachin" target=3D"_blank"><img width=3D"25" height=3D"25" =
src=3D"https://cdn.gifo.wisestamp.com/s/tw/55acee/50/0/background.png" styl=
e=3D"float:left;border:none" border=3D"0"></a></td></tr></tbody></table></t=
d></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table>=
<table cellpadding=3D"0" cellspacing=3D"0" border=3D"0" style=3D"max-width:=
600px;width:100%"><tbody><tr><td style=3D"line-height:0"></td></tr></tbody>=
</table></td></tr></tbody></table><br></div><img src=3D"https://tracy.srv.w=
isestamp.com/px/5434123278745600.png" alt=3D""></div></div></div>

--0000000000003310a00611ca8a8c--

