v3.0.0GA with authentication isTrusted

v3.0.0GA with authentication isTrusted
cas Parameter service fix
This commit is contained in:
Crystal.Sea
2021-09-26 21:28:11 +08:00
parent 9c10a5aad1
commit d1cf180412
15 changed files with 117 additions and 77 deletions

View File

@@ -64,7 +64,7 @@ public class CasAuthorizeEndpoint extends CasBaseAuthorizeEndpoint{
AppsCasDetails casDetails=casDetailsService.getAppDetails(casService);
return buildCasModelAndView(request,response,casDetails);
return buildCasModelAndView(request,response,casDetails,casService);
}
@@ -77,20 +77,34 @@ public class CasAuthorizeEndpoint extends CasBaseAuthorizeEndpoint{
AppsCasDetails casDetails=casDetailsService.getAppDetails(id);
return buildCasModelAndView(request,response,casDetails);
return buildCasModelAndView(request,response,casDetails,casDetails.getCallbackUrl());
}
private ModelAndView buildCasModelAndView(
HttpServletRequest request,
HttpServletResponse response,
AppsCasDetails casDetails){
AppsCasDetails casDetails,
String casService){
_logger.debug(""+casDetails);
Map<String, String> parameterMap = WebContext.getRequestParameterMap(request);
String service = casService;
_logger.debug("CAS Parameter service = " + service);
if(casService.indexOf("?") >-1 ) {
service = casService.substring(casService.indexOf("?") + 1);
if(service.indexOf("=") > -1) {
String [] parameterValues = service.split("=");
if(parameterValues.length == 2) {
parameterMap.put(parameterValues[0], parameterValues[1]);
}
}
_logger.debug("CAS service with Parameter : " + service);
}
WebContext.setAttribute(
CasConstants.PARAMETER.PARAMETER_MAP,
WebContext.getRequestParameterMap(request)
parameterMap
);
WebContext.setAttribute(CasConstants.PARAMETER.ENDPOINT_CAS_DETAILS, casDetails);
WebContext.setAttribute(WebConstants.SINGLE_SIGN_ON_APP_ID, casDetails.getId());
WebContext.setAttribute(WebConstants.AUTHORIZE_SIGN_ON_APP,casDetails);
@@ -116,7 +130,6 @@ public class CasAuthorizeEndpoint extends CasBaseAuthorizeEndpoint{
callbackUrl.append("&");
}
//append ticket
callbackUrl.append(CasConstants.PARAMETER.TICKET).append("=").append(ticket);

View File

@@ -82,7 +82,7 @@ public class CasRestV1Endpoint extends CasBaseAuthorizeEndpoint{
LoginCredential loginCredential =new LoginCredential(username,password,"CASREST");
authenticationProvider.basicAuthenticate(loginCredential);
authenticationProvider.authentication(loginCredential,false);
TicketGrantingTicketImpl ticketGrantingTicket=new TicketGrantingTicketImpl("Random",WebContext.getAuthentication(),null);
@@ -189,7 +189,7 @@ public class CasRestV1Endpoint extends CasBaseAuthorizeEndpoint{
LoginCredential loginCredential =new LoginCredential(username,password,"CASREST");
authenticationProvider.basicAuthenticate(loginCredential);
authenticationProvider.authentication(loginCredential,false);
UserInfo userInfo =WebContext.getUserInfo();
TicketGrantingTicketImpl ticketGrantingTicket=new TicketGrantingTicketImpl("Random",WebContext.getAuthentication(),null);