v3.0.0GA with authentication isTrusted
v3.0.0GA with authentication isTrusted cas Parameter service fix
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@ import javax.servlet.http.HttpServletResponse;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang.Validate;
|
||||
import org.maxkey.authn.AbstractAuthenticationProvider;
|
||||
import org.maxkey.authn.LoginCredential;
|
||||
import org.maxkey.authz.saml.common.EndpointGenerator;
|
||||
import org.maxkey.authz.saml.common.TrustResolver;
|
||||
import org.maxkey.authz.saml.service.IDService;
|
||||
@@ -185,8 +186,9 @@ public class ConsumerEndpoint {
|
||||
|
||||
|
||||
logger.debug("assertion.getID() ", assertion.getAuthnStatements());
|
||||
|
||||
authenticationProvider.trustAuthentication(username, ConstantsLoginType.SAMLTRUST,"","","success");
|
||||
LoginCredential loginCredential =new LoginCredential(
|
||||
username,"",ConstantsLoginType.SAMLTRUST);
|
||||
authenticationProvider.authentication(loginCredential,true);
|
||||
|
||||
ModelAndView mav = new ModelAndView();
|
||||
mav.addObject("username", username);
|
||||
|
||||
Reference in New Issue
Block a user