【发布时间】:2015-10-11 10:11:40
【问题描述】:
我们有一个使用spring-security-oauth2:1.0 的应用程序。我试图将其更改为更新的版本,spring-security-oauth2:2.0.7.RELEASE。如果我没有指定 scope 或者如果我指定了单一范围,则应用程序可以正常工作。我在请求多个作用域(如 read,write)时遇到问题,以前的版本可以使用。
我请求的客户端拥有所有read,write and trust 权限。
当我使用spring-security-oauth2:1.0 时,为了获取令牌,我曾经使用 get 调用类似
如果您看到范围参数scope=read,write,通过这种方式请求,我曾经获得范围为read and write 的令牌。
如果我尝试使用 Oauth2 版本 2.0.7.RELEASE(尽管有 POST 请求)做同样的事情,我会得到 Invalid Scope 异常,因为 tokenRequest 将 read,write 作为单个范围。我请求的客户拥有read,write and trust 权限,但read,write 不是其中之一。
如果我尝试使用scope=write 或scope=read,它会正常工作,因为read 或write 是客户端范围的一部分。
如果我想在OAuth2 2.0.7.RELEASE 中请求多个范围,我该怎么做?
【问题讨论】:
标签: java spring spring-security spring-security-oauth2