Logout null exception
Logout null exception
This commit is contained in:
@@ -85,9 +85,13 @@ public class Organizations extends JpaBaseDomain implements Serializable {
|
||||
private String description;
|
||||
|
||||
private String status;
|
||||
@Column
|
||||
private String extId;
|
||||
@Column
|
||||
private String extParentId;
|
||||
|
||||
public Organizations() {
|
||||
// TODO Auto-generated constructor stub
|
||||
//
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
@@ -309,8 +313,24 @@ public class Organizations extends JpaBaseDomain implements Serializable {
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getExtId() {
|
||||
return extId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setExtId(String extId) {
|
||||
this.extId = extId;
|
||||
}
|
||||
|
||||
public String getExtParentId() {
|
||||
return extParentId;
|
||||
}
|
||||
|
||||
public void setExtParentId(String extParentId) {
|
||||
this.extParentId = extParentId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
builder.append("Organizations [id=");
|
||||
@@ -365,6 +385,10 @@ public class Organizations extends JpaBaseDomain implements Serializable {
|
||||
builder.append(description);
|
||||
builder.append(", status=");
|
||||
builder.append(status);
|
||||
builder.append(", extId=");
|
||||
builder.append(extId);
|
||||
builder.append(", extParentId=");
|
||||
builder.append(extParentId);
|
||||
builder.append("]");
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
@@ -112,32 +112,38 @@ public class LogoutEndpoint {
|
||||
_logger.debug("re Login URL : "+ reLoginUrl);
|
||||
|
||||
modelAndView.addObject("reloginUrl",reLoginUrl);
|
||||
String onlineTicketId = ((SigninPrincipal)WebContext.getAuthentication().getPrincipal()).getOnlineTicket().getTicketId();
|
||||
OnlineTicket onlineTicket = onlineTicketServices.get(onlineTicketId);
|
||||
|
||||
Set<Entry<String, Apps>> entrySet = onlineTicket.getAuthorizedApps().entrySet();
|
||||
|
||||
Iterator<Entry<String, Apps>> iterator = entrySet.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
Entry<String, Apps> mapEntry = iterator.next();
|
||||
_logger.debug("App Id : "+ mapEntry.getKey()+ " , " +mapEntry.getValue());
|
||||
if( mapEntry.getValue().getLogoutType() == LogoutType.BACK_CHANNEL){
|
||||
SingleLogout singleLogout;
|
||||
if(mapEntry.getValue().getProtocol().equalsIgnoreCase(ConstantsProtocols.CAS)) {
|
||||
singleLogout =new SamlSingleLogout();
|
||||
}else {
|
||||
singleLogout = new DefaultSingleLogout();
|
||||
}
|
||||
singleLogout.sendRequest(onlineTicket.getAuthentication(), mapEntry.getValue());
|
||||
}
|
||||
}
|
||||
onlineTicketServices.remove(onlineTicketId);
|
||||
|
||||
//if logined in have onlineTicket ,need remove or logout back
|
||||
if(WebContext.getAuthentication() != null) {
|
||||
String onlineTicketId = ((SigninPrincipal)WebContext.getAuthentication().getPrincipal()).getOnlineTicket().getTicketId();
|
||||
OnlineTicket onlineTicket = onlineTicketServices.get(onlineTicketId);
|
||||
if(onlineTicket != null) {
|
||||
Set<Entry<String, Apps>> entrySet = onlineTicket.getAuthorizedApps().entrySet();
|
||||
|
||||
Iterator<Entry<String, Apps>> iterator = entrySet.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
Entry<String, Apps> mapEntry = iterator.next();
|
||||
_logger.debug("App Id : "+ mapEntry.getKey()+ " , " +mapEntry.getValue());
|
||||
if( mapEntry.getValue().getLogoutType() == LogoutType.BACK_CHANNEL){
|
||||
SingleLogout singleLogout;
|
||||
if(mapEntry.getValue().getProtocol().equalsIgnoreCase(ConstantsProtocols.CAS)) {
|
||||
singleLogout =new SamlSingleLogout();
|
||||
}else {
|
||||
singleLogout = new DefaultSingleLogout();
|
||||
}
|
||||
singleLogout.sendRequest(onlineTicket.getAuthentication(), mapEntry.getValue());
|
||||
}
|
||||
}
|
||||
onlineTicketServices.remove(onlineTicketId);
|
||||
}
|
||||
}
|
||||
//remove ONLINE_TICKET cookie
|
||||
WebContext.expiryCookie(WebContext.getResponse(),
|
||||
this.applicationConfig.getBaseDomainName(),
|
||||
WebConstants.ONLINE_TICKET_NAME,
|
||||
UUID.randomUUID().toString());
|
||||
WebContext.expiryCookie(
|
||||
WebContext.getResponse(),
|
||||
this.applicationConfig.getBaseDomainName(),
|
||||
WebConstants.ONLINE_TICKET_NAME,
|
||||
UUID.randomUUID().toString()
|
||||
);
|
||||
|
||||
request.getSession().invalidate();
|
||||
SecurityContextHolder.clearContext();
|
||||
|
||||
Reference in New Issue
Block a user