@Override public SecurityContext authenticate(String username, String password, X509Certificate[] peerCertificates) throws SecurityException { if (peerCertificates != null) { return this.sslBroker.authenticate(username, password, peerCertificates); } else { return this.nonSslBroker.authenticate(username, password, peerCertificates); } } }
@Override public void addConnection(ConnectionContext context, ConnectionInfo info) throws Exception { if (context.getSecurityContext() == null) { // Set the TCCL since it seems JAAS needs it to find the login module classes. ClassLoader original = Thread.currentThread().getContextClassLoader(); Thread.currentThread().setContextClassLoader(JaasAuthenticationBroker.class.getClassLoader()); SecurityContext securityContext = null; try { securityContext = authenticate(info.getUserName(), info.getPassword(), null); context.setSecurityContext(securityContext); securityContexts.add(securityContext); super.addConnection(context, info); } catch (Exception error) { if (securityContext != null) { securityContexts.remove(securityContext); } context.setSecurityContext(null); throw error; } finally { Thread.currentThread().setContextClassLoader(original); } } else { super.addConnection(context, info); } }
@Override public SecurityContext authenticate(String username, String password, X509Certificate[] peerCertificates) throws SecurityException { if (peerCertificates != null) { return this.sslBroker.authenticate(username, password, peerCertificates); } else { return this.nonSslBroker.authenticate(username, password, peerCertificates); } } }
@Override public SecurityContext authenticate(String username, String password, X509Certificate[] peerCertificates) throws SecurityException { if (peerCertificates != null) { return this.sslBroker.authenticate(username, password, peerCertificates); } else { return this.nonSslBroker.authenticate(username, password, peerCertificates); } } }
@Override public SecurityContext authenticate(String username, String password, X509Certificate[] peerCertificates) throws SecurityException { if (peerCertificates != null) { return this.sslBroker.authenticate(username, password, peerCertificates); } else { return this.nonSslBroker.authenticate(username, password, peerCertificates); } } }
@Override public void addConnection(ConnectionContext context, ConnectionInfo info) throws Exception { if (context.getSecurityContext() == null) { // Set the TCCL since it seems JAAS needs it to find the login module classes. ClassLoader original = Thread.currentThread().getContextClassLoader(); Thread.currentThread().setContextClassLoader(JaasAuthenticationBroker.class.getClassLoader()); SecurityContext securityContext = null; try { securityContext = authenticate(info.getUserName(), info.getPassword(), null); context.setSecurityContext(securityContext); securityContexts.add(securityContext); super.addConnection(context, info); } catch (Exception error) { if (securityContext != null) { securityContexts.remove(securityContext); } context.setSecurityContext(null); throw error; } finally { Thread.currentThread().setContextClassLoader(original); } } else { super.addConnection(context, info); } }
@Override public void addConnection(ConnectionContext context, ConnectionInfo info) throws Exception { if (context.getSecurityContext() == null) { // Set the TCCL since it seems JAAS needs it to find the login module classes. ClassLoader original = Thread.currentThread().getContextClassLoader(); Thread.currentThread().setContextClassLoader(JaasAuthenticationBroker.class.getClassLoader()); SecurityContext securityContext = null; try { securityContext = authenticate(info.getUserName(), info.getPassword(), null); context.setSecurityContext(securityContext); securityContexts.add(securityContext); super.addConnection(context, info); } catch (Exception error) { if (securityContext != null) { securityContexts.remove(securityContext); } context.setSecurityContext(null); throw error; } finally { Thread.currentThread().setContextClassLoader(original); } } else { super.addConnection(context, info); } }
@Override public void addConnection(ConnectionContext context, ConnectionInfo info) throws Exception { if (context.getSecurityContext() == null) { // Set the TCCL since it seems JAAS needs it to find the login module classes. ClassLoader original = Thread.currentThread().getContextClassLoader(); Thread.currentThread().setContextClassLoader(JaasAuthenticationBroker.class.getClassLoader()); SecurityContext securityContext = null; try { securityContext = authenticate(info.getUserName(), info.getPassword(), null); context.setSecurityContext(securityContext); securityContexts.add(securityContext); super.addConnection(context, info); } catch (Exception error) { if (securityContext != null) { securityContexts.remove(securityContext); } context.setSecurityContext(null); throw error; } finally { Thread.currentThread().setContextClassLoader(original); } } else { super.addConnection(context, info); } }