CAS service ${errorMessage!} not registered .

This commit is contained in:
MaxKey
2022-09-02 21:02:46 +08:00
parent c2d7230e2a
commit 0636df5d3c
4 changed files with 59 additions and 47 deletions

View File

@@ -106,6 +106,12 @@ public class SingleSignOnInterceptor implements AsyncHandlerInterceptor {
request.getParameter(OAuth2Constants.PARAMETER.CLIENT_ID),true);
}
}
if(app == null) {
_logger.debug("preHandle app is not exist . ");
return true;
}
SignPrincipal principal = AuthorizationUtils.getPrincipal();
if(principal != null && app !=null) {
if(principal.getGrantedAuthorityApps().contains(new SimpleGrantedAuthority(app.getId()))) {

View File

@@ -5,24 +5,29 @@
<#include "authorize_common.ftl">
<script type="text/javascript">
function redirectToLogin(){
<#if callbackUrl??>
var srcUrl = window.top.location.href;
srcUrl = srcUrl.substring(srcUrl.indexOf("#"));
var callbackUrl = "${callbackUrl}";
var callbackUrl = "${callbackUrl!}";
if(srcUrl.indexOf("#") >-1 ){
callbackUrl =callbackUrl + srcUrl;
}
window.top.location.href = callbackUrl;
</#if>
}
</script>
</head>
<body onload="redirectToLogin()" style="display:none">
<form id="cas_sso_form" name="cas_sso_form" action="${callbackUrl}" method="get">
<table style="width:100%">
<tr>
<td colspan="2"><input type="submit" name="submitBtn" value="Continue..." /></td>
</tr>
</table>
</form>
<body onload="redirectToLogin()" >
<form id="cas_sso_form" name="cas_sso_form" action="${callbackUrl!}" method="get" style="display:none">
<table style="width:100%">
<tr>
<td colspan="2"><input type="submit" name="submitBtn" value="Continue..." /></td>
</tr>
</table>
</form>
<#if errorMessage??>
service ${errorMessage!} not registered .
</#if>
</body>
</html>