private void logout() { try { SecurityService securityService = SystemInstance.get().getComponent(SecurityService.class); if (clientIdentity != null) { logger.info("Logging out"); securityService.logout(clientIdentity); ClientSecurity.setIdentity(null); } } catch (LoginException e) { throw new RuntimeException("User could not be logged out.", e); } }
Object localClientIdentity = ClientSecurity.getIdentity(); try { if (callContext == null && localClientIdentity != null) {
public CUTask(final Object task) { super(task); Object stateTmp = SECURITY_SERVICE.currentState(); final boolean associate; if (stateTmp == null) { stateTmp = ClientSecurity.getIdentity(); associate = stateTmp != null; } else { associate = false; } final ThreadContext threadContext = ThreadContext.getThreadContext(); final AbstractSecurityService.SecurityContext sc = threadContext == null ? null : threadContext.get(AbstractSecurityService.SecurityContext.class); if (threadContext != null && threadContext.getBeanContext() != null && (threadContext.getBeanContext().getRunAs() != null || threadContext.getBeanContext().getRunAsUser() != null)) { initialContext = new Context( associate, stateTmp, new AbstractSecurityService.SecurityContext(AbstractSecurityService.class.cast(SECURITY_SERVICE).getRunAsSubject(threadContext.getBeanContext())), threadContext, Thread.currentThread().getContextClassLoader(), null); } else { initialContext = new Context(associate, stateTmp, sc, threadContext, Thread.currentThread().getContextClassLoader(), null); } if (CONTAINER_LISTENERS.length > 0) { containerListenerStates = new Object[CONTAINER_LISTENERS.length]; for (int i = 0; i < CONTAINER_LISTENERS.length; i++) { containerListenerStates[i] = CONTAINER_LISTENERS[i].onCreation(); } } else { containerListenerStates = null; } }
private void login() throws AuthenticationException { String user = (String) properties.get(Context.SECURITY_PRINCIPAL); String pass = (String) properties.get(Context.SECURITY_CREDENTIALS); String realmName = (String) properties.get("openejb.authentication.realmName"); if (user != null && pass != null){ try { logger.info("Logging in"); SecurityService securityService = SystemInstance.get().getComponent(SecurityService.class); if (realmName == null) { clientIdentity = securityService.login(user, pass); } else { clientIdentity = securityService.login(realmName, user, pass); } ClientSecurity.setIdentity(clientIdentity); } catch (LoginException e) { throw (AuthenticationException) new AuthenticationException("User could not be authenticated: "+user).initCause(e); } } }
final Object localClientIdentity = ClientSecurity.getIdentity(); try { if (callContext == null && localClientIdentity != null) {
private void login() throws AuthenticationException { final String user = (String) properties.get(Context.SECURITY_PRINCIPAL); final String pass = (String) properties.get(Context.SECURITY_CREDENTIALS); final String realmName = (String) properties.get("openejb.authentication.realmName"); if (user != null && pass != null) { try { if (logger.isDebugEnabled()) { logger.debug("Logging in: " + user); } final SecurityService securityService = SystemInstance.get().getComponent(SecurityService.class); if (realmName == null) { clientIdentity = securityService.login(user, pass); } else { clientIdentity = securityService.login(realmName, user, pass); } ClientSecurity.setIdentity(clientIdentity); } catch (final LoginException e) { throw (AuthenticationException) new AuthenticationException("User could not be authenticated: " + user).initCause(e); } } }
final Object localClientIdentity = ClientSecurity.getIdentity(); try { if (callContext == null && localClientIdentity != null) {
private void login() throws AuthenticationException { final String user = (String) properties.get(Context.SECURITY_PRINCIPAL); final String pass = (String) properties.get(Context.SECURITY_CREDENTIALS); final String realmName = (String) properties.get("openejb.authentication.realmName"); if (user != null && pass != null) { try { if (logger.isDebugEnabled()) { logger.debug("Logging in: " + user); } final SecurityService securityService = SystemInstance.get().getComponent(SecurityService.class); if (realmName == null) { clientIdentity = securityService.login(user, pass); } else { clientIdentity = securityService.login(realmName, user, pass); } ClientSecurity.setIdentity(clientIdentity); } catch (final LoginException e) { throw (AuthenticationException) new AuthenticationException("User could not be authenticated: " + user).initCause(e); } } }
final boolean associate; if (stateTmp == null) { stateTmp = ClientSecurity.getIdentity(); associate = stateTmp != null; } else {
@SuppressWarnings("unchecked") private void logout() { try { final SecurityService securityService = SystemInstance.get().getComponent(SecurityService.class); if (clientIdentity != null) { if (logger.isDebugEnabled()) { logger.debug("Logging out: " + clientIdentity); } securityService.logout(clientIdentity); ClientSecurity.setIdentity(null); } } catch (final LoginException e) { throw new OpenEJBRuntimeException("User could not be logged out.", e); } }
final boolean associate; if (stateTmp == null) { stateTmp = ClientSecurity.getIdentity(); associate = stateTmp != null; } else {
@SuppressWarnings("unchecked") private void logout() { try { if (clientIdentity != null) { if (logger.isDebugEnabled()) { logger.debug("Logging out: " + clientIdentity); } final SecurityService securityService = SystemInstance.get().getComponent(SecurityService.class); if (null != securityService) { securityService.logout(clientIdentity); } ClientSecurity.setIdentity(null); } } catch (final LoginException e) { throw new OpenEJBRuntimeException("User could not be logged out.", e); } }