mkk 关于资源的解释 : https://andaily.com/blog/?cat=19
resource用于将系统提供的各类资源进行分组管理,
每一个resource对应一个resource-id, 而一个client details至少要有一个resource-id (对应OauthClientDetails.resourceIds oauth_client_details.resource_ids).
1、配置resourceId
在spring-oauth-server的security.xml配置了两个资源id:
这就是配置resource的地方, 看见里面的两个resource-id值.
2、使用resourceId
在spring-oauth-server的security.xml配置了两个<http>配置, 一个的pattern为/m/**, 另一个为/unity/**,
这就是资源与Spring Security整合后的配置,
注意每个<http>配置里的 ROLE_UNITY与ROLE_MOBILE, 这对应Spring Security的权限,应数据库中的user_.previllage:
同理 scope_read字段对应数据库中的oauth_client_details.scope.