Explorar o código

not have authority access app tip

MaxKey %!s(int64=2) %!d(string=hai) anos
pai
achega
13def2a4c3

+ 9 - 0
maxkey-protocols/maxkey-protocol-authorize/src/main/java/org/maxkey/authz/endpoint/AuthorizeEndpoint.java

@@ -88,4 +88,13 @@ public class AuthorizeEndpoint extends AuthorizeBaseEndpoint{
 		return modelAndView;
 	}
 	
+	@RequestMapping("/authz/refused")
+	public ModelAndView refused(){
+		ModelAndView modelAndView = new ModelAndView("authorize/authorize_refused");
+		Apps app = (Apps)WebContext.getAttribute(WebConstants.AUTHORIZE_SIGN_ON_APP);
+		app.transIconBase64();
+		modelAndView.addObject("model", app);
+		return modelAndView;
+	}
+	
 }

+ 1 - 0
maxkey-webs/maxkey-web-maxkey/src/main/java/org/maxkey/MaxKeyMvcConfig.java

@@ -139,6 +139,7 @@ public class MaxKeyMvcConfig implements WebMvcConfigurer {
         		.addPathPatterns("/logon/oauth20/bind/**")
         		.addPathPatterns("/logout")
                 .addPathPatterns("/logout/**")
+                .addPathPatterns("/authz/refused")
                 ;
         
         _logger.debug("add Permission Interceptor");

+ 1 - 1
maxkey-webs/maxkey-web-maxkey/src/main/java/org/maxkey/web/interceptor/SingleSignOnInterceptor.java

@@ -114,7 +114,7 @@ public class SingleSignOnInterceptor  implements AsyncHandlerInterceptor {
 	            }
 	        }
 	        _logger.debug("preHandle not have authority access " + app);
-	        return false;
+	        response.sendRedirect(request.getContextPath()+"/authz/refused");
     	}
         return true;
     }

+ 3 - 0
maxkey-webs/maxkey-web-maxkey/src/main/resources/messages/message.properties

@@ -17,6 +17,9 @@ login.session.timeout.tip=\u767B\u5F55\u4F1A\u8BDD\u8D85\u65F6
 login.session.timeout.prefix=\u60A8\u7684\u767B\u5F55\u4F1A\u8BDD\u5DF2\u7ECF\u8D85\u65F6\uFF0C\u8BF7
 login.session.timeout.suffix=\u91CD\u65B0\u767B\u5F55
 
+login.authz.refuse=\u4F60\u6CA1\u6709\u6743\u9650\u8BBF\u95EE\u8BE5\u5E94\u7528\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\u3002
+common.text.close=\u5173\u95ED
+
 common.window.title=\u7A97\u53E3
 common.alert.title=\u63D0\u793A\u4FE1\u606F
 common.alert.closeText=\u5173\u95ED

+ 3 - 0
maxkey-webs/maxkey-web-maxkey/src/main/resources/messages/message_en.properties

@@ -17,6 +17,9 @@ login.session.timeout.tip=Login session timeout
 login.session.timeout.prefix=Your login session has timed out. Please
 login.session.timeout.suffix=re-login 
 
+login.authz.refuse=You don't have authority to access this app, please contact the administrator.
+common.text.close=Close
+
 common.window.title=Window
 common.alert.title=Information
 common.alert.closeText=Close

+ 3 - 0
maxkey-webs/maxkey-web-maxkey/src/main/resources/messages/message_zh_CN.properties

@@ -17,6 +17,9 @@ login.session.timeout.tip=\u767B\u5F55\u4F1A\u8BDD\u8D85\u65F6
 login.session.timeout.prefix=\u60A8\u7684\u767B\u5F55\u4F1A\u8BDD\u5DF2\u7ECF\u8D85\u65F6\uFF0C\u8BF7
 login.session.timeout.suffix=\u91CD\u65B0\u767B\u5F55
 
+login.authz.refuse=\u4F60\u6CA1\u6709\u6743\u9650\u8BBF\u95EE\u8BE5\u5E94\u7528\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\u3002
+common.text.close=\u5173\u95ED
+
 common.window.title=\u7A97\u53E3
 common.alert.title=\u63D0\u793A\u4FE1\u606F
 common.alert.closeText=\u5173\u95ED

+ 26 - 0
maxkey-webs/maxkey-web-maxkey/src/main/resources/templates/views/authorize/authorize_refused.ftl

@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html >
+<head>
+    <title>Refuse To Access</title>
+    <#include  "authorize_common.ftl">
+</head>
+
+<body>
+<center>
+    <form id="refuse_form" name="refuse_form" action="" method="get">
+    
+		<table style="width:400px">
+			<tr>
+				<td colspan='2'><@locale code="login.authz.refuse" /></td>
+			</tr>
+			<tr>
+				<td><img src="${model.iconBase64}"/></td><td>${model.appName}</td>
+			</tr>
+			<tr style="display:none">
+				<td>${model.id}</td>
+			</tr>
+		</table>
+	</form>
+</center>
+</body>
+</html>