not have authority access app tip

This commit is contained in:
MaxKey 2022-07-30 19:08:11 +08:00
parent c3db084e3d
commit 13def2a4c3
7 changed files with 46 additions and 1 deletions

View File

@ -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;
}
}

View File

@ -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");

View File

@ -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;
}

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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>