OpenID Connect是否支持引用作用域?
例如,请求openid
作用域是否与请求"openid"
作用域相同?
如果是,这是否意味着作用域允许包含空格?
我试着看了一下这个规范,但是在这个问题上它是模糊的。
见原oauth2 rfc:
The value of the scope parameter is expressed as a list of space-
delimited, case-sensitive strings. The strings are defined by the
authorization server. If the value contains multiple space-delimited
strings, their order does not matter, and each string adds an
additional access range to the requested scope.
scope = scope-token *( SP scope-token )
scope-token = 1*( %x21 / %x23-5B / %x5D-7E )
由此可见,openid
和"openid"
是不同的作用域,作用域名称用空格分隔(因此不允许作为作用域名称的一部分)。
请注意,在scope-token中,它显式省略了%x22,这是双引号。所以"openid"
不是一个有效的作用域名。顺便说一句,它还删除了%x5C,这是一个反斜杠,可能是为了使授权服务器实现中的验证更容易。