本文整理了Java中org.jboss.security.AuthenticationManager.logout()
方法的一些代码示例,展示了AuthenticationManager.logout()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AuthenticationManager.logout()
方法的具体详情如下:
包路径:org.jboss.security.AuthenticationManager
类名称:AuthenticationManager
方法名:logout
[英]This method must be invoked to perform the logout of the incoming principal. The Subject associated with the principal is also provided, allowing implementations to perform any special cleanup based on the information contained in the Subject.
[中]必须调用此方法来执行传入主体的注销。还提供了与主体关联的主题,允许实现基于主题中包含的信息执行任何特殊清理。
代码示例来源:origin: wildfly/wildfly
private void clearAccount(Account account) {
Principal principal = (account instanceof AccountImpl) ? ((AccountImpl) account).getOriginalPrincipal() :
account.getPrincipal();
if (principal != null) {
// perform the logout of the principal using the subject currently set in the security context.
Subject subject = SecurityActions.getSubject();
this.manager.logout(principal, subject);
}
}
}
代码示例来源:origin: wildfly/wildfly
@Override
public void handleNotification(SecurityNotification notification) {
if (notification.getEventType() == SecurityNotification.EventType.LOGGED_OUT) {
Account account = notification.getAccount();
Principal principal = (account instanceof AccountImpl) ? ((AccountImpl) account).getOriginalPrincipal() :
account.getPrincipal();
if (principal != null) {
// perform the logout of the principal using the subject currently set in the security context.
Subject subject = SecurityActions.getSubject();
this.manager.logout(principal, subject);
}
// Clear old context
SecurityActions.clearSecurityContext();
SecurityActions.setSecurityRoles(null);
// Set a new one in case re-authentication is done within the same thread
org.jboss.security.SecurityContext securityContext = SecurityActions.createSecurityContext(securityDomain);
notification.getExchange().putAttachment(UndertowSecurityAttachments.SECURITY_CONTEXT_ATTACHMENT, securityContext);
SecurityActions.setSecurityContextOnAssociation(securityContext);
}
}
}
代码示例来源:origin: org.wildfly/wildfly-undertow
private void clearAccount(Account account) {
Principal principal = (account instanceof AccountImpl) ? ((AccountImpl) account).getOriginalPrincipal() :
account.getPrincipal();
if (principal != null) {
// perform the logout of the principal using the subject currently set in the security context.
Subject subject = SecurityActions.getSubject();
this.manager.logout(principal, subject);
}
}
}
代码示例来源:origin: org.jboss.eap/wildfly-undertow
private void clearAccount(Account account) {
Principal principal = (account instanceof AccountImpl) ? ((AccountImpl) account).getOriginalPrincipal() :
account.getPrincipal();
if (principal != null) {
// perform the logout of the principal using the subject currently set in the security context.
Subject subject = SecurityActions.getSubject();
this.manager.logout(principal, subject);
}
}
}
代码示例来源:origin: ModeShape/modeshape
@Override
public void logout() {
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("Logging out security context....");
}
authenticationManager.logout(SimplePrincipal.newInstance(jaasSecurityContext.getUserName()), null);
jaasSecurityContext.logout();
}
}
代码示例来源:origin: org.jboss.eap/wildfly-undertow
@Override
public void handleNotification(SecurityNotification notification) {
if (notification.getEventType() == SecurityNotification.EventType.LOGGED_OUT) {
Account account = notification.getAccount();
Principal principal = (account instanceof AccountImpl) ? ((AccountImpl) account).getOriginalPrincipal() :
account.getPrincipal();
if (principal != null) {
// perform the logout of the principal using the subject currently set in the security context.
Subject subject = SecurityActions.getSubject();
this.manager.logout(principal, subject);
}
// Clear old context
SecurityActions.clearSecurityContext();
SecurityActions.setSecurityRoles(null);
// Set a new one in case re-authentication is done within the same thread
org.jboss.security.SecurityContext securityContext = SecurityActions.createSecurityContext(securityDomain);
notification.getExchange().putAttachment(UndertowSecurityAttachments.SECURITY_CONTEXT_ATTACHMENT, securityContext);
SecurityActions.setSecurityContextOnAssociation(securityContext);
}
}
}
代码示例来源:origin: org.wildfly/wildfly-undertow
@Override
public void handleNotification(SecurityNotification notification) {
if (notification.getEventType() == SecurityNotification.EventType.LOGGED_OUT) {
Account account = notification.getAccount();
Principal principal = (account instanceof AccountImpl) ? ((AccountImpl) account).getOriginalPrincipal() :
account.getPrincipal();
if (principal != null) {
// perform the logout of the principal using the subject currently set in the security context.
Subject subject = SecurityActions.getSubject();
this.manager.logout(principal, subject);
}
// Clear old context
SecurityActions.clearSecurityContext();
SecurityActions.setSecurityRoles(null);
// Set a new one in case re-authentication is done within the same thread
org.jboss.security.SecurityContext securityContext = SecurityActions.createSecurityContext(securityDomain);
notification.getExchange().putAttachment(UndertowSecurityAttachments.SECURITY_CONTEXT_ATTACHMENT, securityContext);
SecurityActions.setSecurityContextOnAssociation(securityContext);
}
}
}
内容来源于网络,如有侵权,请联系作者删除!