LdapPrincipal principal = getDirectoryService().getAdminSession().getAnonymousPrincipal(); IoSession session = bindContext.getIoSession();
/** * User has already been authenticated during SASL negotiation. Set the authentication level * to strong and return an {@link LdapPrincipal}. */ @Override public LdapPrincipal authenticate( BindOperationContext bindContext ) throws LdapAuthenticationException { // Possibly check if user account is disabled, other account checks. LdapPrincipal principal = new LdapPrincipal( getDirectoryService().getSchemaManager(), bindContext.getDn(), AuthenticationLevel.STRONG ); IoSession session = bindContext.getIoSession(); if ( session != null ) { SocketAddress clientAddress = session.getRemoteAddress(); principal.setClientAddress( clientAddress ); SocketAddress serverAddress = session.getServiceAddress(); principal.setServerAddress( serverAddress ); } return principal; } }
IoSession session = bindContext.getIoSession();
bindContext.getCredentials() ); IoSession session = bindContext.getIoSession();
( ( DefaultCoreSession ) coreSession ).setIoSession( bindContext.getIoSession() );