public boolean login() throws LoginException {
        if ("simple".equals(connectionAuth)) {
            return super.login();
        }else if ("bind".equals(connectionAuth)) {
            log.debug("login using bind");
            try {
                if (callbackHandler == null) {
                    throw new LoginException("No callback handler");
                }

                Callback[] callbacks = configureCallbacks();
                callbackHandler.handle(callbacks);

                String webUserName = ((NameCallback) callbacks[0]).getName();
                Object webCredential = ((ObjectCallback) callbacks[1]).getObject();

                if ((webUserName == null) || (webCredential == null)) {
                    setAuthenticated(false);
                    return isAuthenticated();
                }
                ArrayList roleList = new ArrayList(getUserRoles(webUserName));
                UserInfo userInfo= new UserInfo(webUserName, null, roleList);

                log.debug("userRoles: " + roleList);
                if (userInfo == null) {
                    setAuthenticated(false);
                    return isAuthenticated();
                }

                currentUser = new JAASUserInfo(userInfo);
                //bind with user info
                setAuthenticated(authbindContext(webUserName, (String) webCredential));
                log.debug("login returning: isAuthenticated? " + isAuthenticated());

                return isAuthenticated();
            }
            catch (IOException e) {
                log.error(e);
                throw new LoginException(e.toString());
            }
            catch (UnsupportedCallbackException e) {
                log.error(e);
                throw new LoginException(e.toString());
            }
            catch (Exception e) {
                log.error(e);
                throw new LoginException(e.toString());
            }
        } else {
            throw new IllegalStateException(CONNECTION_AUTH_TYPE + " was an unrecognized value: " + connectionAuth);
        }
    }