diff --git a/others/oauth_test.txt b/others/oauth_test.txt index 9ef0a96..5971f8f 100644 --- a/others/oauth_test.txt +++ b/others/oauth_test.txt @@ -19,6 +19,9 @@ http://localhost:8080/oauth/token?client_id=unity-client&client_secret=unity&gra 方式2:基于客户端 (注意参数中的username,password,对应用户的账号,密码) [GET] http://localhost:8080/oauth/token?client_id=mobile-client&client_secret=mobile&grant_type=password&scope=read,write&username=mobile&password=mobile +说明:由于unity-client不支持password,所以若用unity-client通过password方式去授权,将返回invalid_grant +http://localhost:8080/oauth/token?client_id=unity-client&client_secret=unity&grant_type=password&scope=read,write&username=mobile&password=mobile + 获取access_token响应的数据如: diff --git a/src/main/webapp/index.jsp b/src/main/webapp/index.jsp index b0c92db..3d712d9 100644 --- a/src/main/webapp/index.jsp +++ b/src/main/webapp/index.jsp @@ -20,12 +20,21 @@ 操作说明:
+ 菜单 User 是不需要Oauth 验证即可访问的(即公开的resource) +
+ 菜单 Unity 与 Mobile 需要Oauth 验证后才能访问(即受保护的resource);
+ Unity 需要 [ROLE_UNITY] 权限, Mobile 需要 [ROLE_MOBILE] 权限.
+
+ 在项目的 others目录里有 oauth_test.txt文件, 里面有测试的URL地址(包括浏览器与客户端的),
+ 若想访问 Unity 与 Mobile, 则先用基于浏览器的测试URL 访问,等验证通过后即可访问(注意不同的账号对应的权限).
+