220413
This commit is contained in:
@@ -36,7 +36,6 @@ import org.maxkey.authz.cas.endpoint.ticket.ProxyTicketImpl;
|
||||
import org.maxkey.authz.cas.endpoint.ticket.Ticket;
|
||||
import org.maxkey.authz.endpoint.adapter.AbstractAuthorizeAdapter;
|
||||
import org.maxkey.constants.ConstsBoolean;
|
||||
import org.maxkey.entity.UserInfo;
|
||||
import org.maxkey.util.Instance;
|
||||
import org.maxkey.util.StringUtils;
|
||||
import org.maxkey.web.HttpResponseConstants;
|
||||
@@ -228,11 +227,8 @@ For all error codes, it is RECOMMENDED that CAS provide a more detailed message
|
||||
_logger.error("setProperty error . ", e);
|
||||
}
|
||||
|
||||
UserInfo userInfo = (UserInfo) userInfoService.findByUsername(authentication.getUsername());
|
||||
|
||||
AbstractAuthorizeAdapter adapter =(AbstractAuthorizeAdapter)samlAdapter;
|
||||
adapter.setAuthentication(authentication);
|
||||
adapter.setUserInfo(userInfo);
|
||||
adapter.setPrincipal(authentication);
|
||||
adapter.setApp(storedTicket.getCasDetails());
|
||||
adapter.generateInfo();
|
||||
}
|
||||
@@ -345,11 +341,8 @@ Response on ticket validation failure:
|
||||
_logger.error("setProperty error . ", e);
|
||||
}
|
||||
|
||||
UserInfo userInfo = (UserInfo) userInfoService.findByUsername(authentication.getUsername());
|
||||
|
||||
AbstractAuthorizeAdapter adapter =(AbstractAuthorizeAdapter)samlAdapter;
|
||||
adapter.setAuthentication(authentication);
|
||||
adapter.setUserInfo(userInfo);
|
||||
adapter.setPrincipal(authentication);
|
||||
adapter.setApp(storedTicket.getCasDetails());
|
||||
adapter.generateInfo();
|
||||
}
|
||||
|
||||
@@ -36,7 +36,6 @@ import org.maxkey.authz.cas.endpoint.ticket.ProxyTicketImpl;
|
||||
import org.maxkey.authz.cas.endpoint.ticket.Ticket;
|
||||
import org.maxkey.authz.endpoint.adapter.AbstractAuthorizeAdapter;
|
||||
import org.maxkey.constants.ConstsBoolean;
|
||||
import org.maxkey.entity.UserInfo;
|
||||
import org.maxkey.util.Instance;
|
||||
import org.maxkey.util.StringUtils;
|
||||
import org.maxkey.web.HttpResponseConstants;
|
||||
@@ -109,11 +108,8 @@ public class Cas30AuthorizeEndpoint extends CasBaseAuthorizeEndpoint{
|
||||
_logger.error("setProperty error . ", e);
|
||||
}
|
||||
|
||||
UserInfo userInfo = (UserInfo) userInfoService.findByUsername(authentication.getUsername());
|
||||
|
||||
AbstractAuthorizeAdapter adapter =(AbstractAuthorizeAdapter)samlAdapter;
|
||||
adapter.setAuthentication(authentication);
|
||||
adapter.setUserInfo(userInfo);
|
||||
adapter.setPrincipal(authentication);
|
||||
adapter.setApp(storedTicket.getCasDetails());
|
||||
adapter.generateInfo();
|
||||
}
|
||||
@@ -190,11 +186,8 @@ public class Cas30AuthorizeEndpoint extends CasBaseAuthorizeEndpoint{
|
||||
_logger.error("setProperty error . ", e);
|
||||
}
|
||||
|
||||
UserInfo userInfo = (UserInfo) userInfoService.findByUsername(authentication.getUsername());
|
||||
|
||||
AbstractAuthorizeAdapter adapter =(AbstractAuthorizeAdapter)samlAdapter;
|
||||
adapter.setAuthentication(authentication);
|
||||
adapter.setUserInfo(userInfo);
|
||||
adapter.setPrincipal(authentication);
|
||||
adapter.setApp(storedTicket.getCasDetails());
|
||||
adapter.generateInfo();
|
||||
}
|
||||
|
||||
@@ -149,7 +149,7 @@ public class CasAuthorizeEndpoint extends CasBaseAuthorizeEndpoint{
|
||||
}
|
||||
|
||||
if(casDetails.getLogoutType()==LogoutType.BACK_CHANNEL) {
|
||||
String onlineTicketId = AuthorizationUtils.getPrincipal().getOnlineTicket().getTicketId();
|
||||
String onlineTicketId = AuthorizationUtils.getPrincipal().getOnlineTicket().getFormattedTicketId();
|
||||
OnlineTicket onlineTicket = onlineTicketService.get(onlineTicketId);
|
||||
//set cas ticket as OnlineTicketId
|
||||
casDetails.setOnlineTicket(ticket);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright [2020] [MaxKey of copyright http://www.maxkey.top]
|
||||
* Copyright [2022] [MaxKey of copyright http://www.maxkey.top]
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -75,7 +75,7 @@ public class CasDefaultAdapter extends AbstractAuthorizeAdapter {
|
||||
serviceResponseBuilder.setAttribute("departmentId", userInfo.getDepartmentId());
|
||||
serviceResponseBuilder.setAttribute("workRegion",base64Attr(userInfo.getWorkRegion()));
|
||||
serviceResponseBuilder.setAttribute("institution", userInfo.getInstId());
|
||||
serviceResponseBuilder.setAttribute(WebConstants.ONLINE_TICKET_NAME,authentication.getOnlineTicket().getTicketId());
|
||||
serviceResponseBuilder.setAttribute(WebConstants.ONLINE_TICKET_NAME,principal.getOnlineTicket().getFormattedTicketId());
|
||||
|
||||
return serviceResponseBuilder;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user