public LoginContext authenticate(String user, char[] password, String realm) {
		// consider modules: Krb5LoginModule, LdapLoginModule, NTLoginModule,
		// JndiLoginModule
		// ...sun...
		PassiveCallbackHandler cbh = new PassiveCallbackHandler(user, password);
		LoginContext lc;
		try {
			lc = new LoginContext(realm, cbh); // referenced in jaas.conf
		} catch (LoginException e) {
			LOG.error("Exception during new LoginContext()", e);
			return null;
		}
		try {
			// call callback to retrieve credentials, and checks that
			// Authentication fails
			lc.login();
		} catch (LoginException e) {
			// FIXME. LoginException may happen either because authentication
			// failed, or for many other reasons.
			// We should ignore the first, and LOG the latter.
			LOG.error("Exception while loggin-in", e);
			return null;
		} finally {
			Arrays.fill(password, '\u0000');
		}
		return lc;
	}
public LoginContext authenticate(String user, char[] password, String realm) {
	
	
	
		PassiveCallbackHandler cbh = new PassiveCallbackHandler(user, password);
		LoginContext lc;
		try {
			lc = new LoginContext(realm, cbh);
		} catch (LoginException e) {
			LOG.error("Exception during new LoginContext()", e);
			return null;
		}
		try {
		
		
			lc.login();
		} catch (LoginException e) {
		
		
		
			LOG.error("Exception while loggin-in", e);
			return null;
		} finally {
			Arrays.fill(password, '\u0000');
		}
		return lc;
	}
public logincontext authenticate(string user, char[] password, string realm) { passivecallbackhandler cbh = new passivecallbackhandler(user, password); logincontext lc; try { lc = new logincontext(realm, cbh); } catch (loginexception e) { log.error("exception during new logincontext()", e); return null; } try { lc.login(); } catch (loginexception e) { log.error("exception while loggin-in", e); return null; } finally { arrays.fill(password, '\u0000'); } return lc; }