From 4700da0be31de9ebe5c63e01755e86b1b48f6998 Mon Sep 17 00:00:00 2001 From: lishengzhao Date: Fri, 15 May 2015 16:09:45 +0800 Subject: [PATCH] 00007 Security implement different privilege --- others/oauth_test.txt | 7 +++++++ src/main/webapp/WEB-INF/jsp/mobile/dashboard.jsp | 2 ++ src/main/webapp/WEB-INF/jsp/oauth_error.jsp | 2 ++ src/main/webapp/WEB-INF/jsp/unity/dashboard.jsp | 2 ++ 4 files changed, 13 insertions(+) diff --git a/others/oauth_test.txt b/others/oauth_test.txt index 59f31c2..9ef0a96 100644 --- a/others/oauth_test.txt +++ b/others/oauth_test.txt @@ -1,7 +1,14 @@ 方式1:基于浏览器 (访问时后跳到登录页面,登录成功后跳转到redirect_uri指定的地址) [GET] +说明:只能使用admin或unity 账号登录才能有权限访问,若使用mobile账号登录将返回Access is denied http://localhost:8080/oauth/authorize?client_id=unity-client&redirect_uri=http%3a%2f%2flocalhost%3a8080%2funity%2fdashboard.htm&response_type=code&scope=read +说明: 由于mobile-client只支持password,refresh_token, 所以不管用哪个账号登录后都将返回Illegal action +http://localhost:8080/oauth/authorize?client_id=mobile-client&redirect_uri=http%3a%2f%2flocalhost%3a8080%2fmobile%2fdashboard.htm&response_type=code&scope=read + + + + 响应的URL如: http://localhost:8080/unity/dashboard.htm?code=zLl170 diff --git a/src/main/webapp/WEB-INF/jsp/mobile/dashboard.jsp b/src/main/webapp/WEB-INF/jsp/mobile/dashboard.jsp index 3ad2bf4..86af062 100644 --- a/src/main/webapp/WEB-INF/jsp/mobile/dashboard.jsp +++ b/src/main/webapp/WEB-INF/jsp/mobile/dashboard.jsp @@ -10,6 +10,8 @@ Mobile dashboard +Home +

Hi Mobile.

\ No newline at end of file diff --git a/src/main/webapp/WEB-INF/jsp/oauth_error.jsp b/src/main/webapp/WEB-INF/jsp/oauth_error.jsp index 51ce388..85b9000 100644 --- a/src/main/webapp/WEB-INF/jsp/oauth_error.jsp +++ b/src/main/webapp/WEB-INF/jsp/oauth_error.jsp @@ -10,6 +10,8 @@ Oauth Error +Home +

Illegal action.

diff --git a/src/main/webapp/WEB-INF/jsp/unity/dashboard.jsp b/src/main/webapp/WEB-INF/jsp/unity/dashboard.jsp index 46602c2..551bbd6 100644 --- a/src/main/webapp/WEB-INF/jsp/unity/dashboard.jsp +++ b/src/main/webapp/WEB-INF/jsp/unity/dashboard.jsp @@ -10,6 +10,8 @@ Unity dashboard +Home +

Hi Unity.

\ No newline at end of file