public boolean abort() throws LoginException { try { _rootContext.close(); } catch (NamingException e) { throw new LoginException( "error closing root context: " + e.getMessage() ); } return super.abort(); }
public boolean commit() throws LoginException { try { _rootContext.close(); } catch (NamingException e) { throw new LoginException( "error closing root context: " + e.getMessage() ); } return super.commit(); }
/** * @see javax.security.auth.spi.LoginModule#abort() * @throws LoginException */ public boolean abort() throws LoginException { this.currentUser = null; return (isAuthenticated() && isCommitted()); }
/** * @see javax.security.auth.spi.LoginModule#commit() * @return true if committed, false if not (likely not authenticated) * @throws LoginException */ public boolean commit() throws LoginException { if (!isAuthenticated()) { currentUser = null; setCommitted(false); return false; } setCommitted(true); currentUser.setJAASInfo(subject); return true; }
if (isIgnored()) return false; throw new LoginException ("No callback handler"); Callback[] callbacks = configureCallbacks(); callbackHandler.handle(callbacks); setAuthenticated(false); throw new FailedLoginException(); UserInfo userInfo = getUserInfo(webUserName); setAuthenticated(false); throw new FailedLoginException(); setAuthenticated(currentUser.checkCredential(webCredential)); if (isAuthenticated()) return true; else
/** * Read contents of the configured property file. * * @see javax.security.auth.spi.LoginModule#initialize(javax.security.auth.Subject, javax.security.auth.callback.CallbackHandler, java.util.Map, * java.util.Map) * @param subject * @param callbackHandler * @param sharedState * @param options */ public void initialize(Subject subject, CallbackHandler callbackHandler, Map<String, ?> sharedState, Map<String, ?> options) { super.initialize(subject,callbackHandler,sharedState,options); setupPropertyUserStore(options); }
if (isIgnored()) return false; throw new LoginException ("No callback handler"); Callback[] callbacks = configureCallbacks(); callbackHandler.handle(callbacks); setAuthenticated(false); throw new FailedLoginException(); UserInfo userInfo = getUserInfo(webUserName); setAuthenticated(false); throw new FailedLoginException(); setAuthenticated(currentUser.checkCredential(webCredential)); if (isAuthenticated()) return true; else
/** * @see javax.security.auth.spi.LoginModule#commit() * @return true if committed, false if not (likely not authenticated) * @throws LoginException */ public boolean commit() throws LoginException { if (!isAuthenticated()) { currentUser = null; setCommitted(false); return false; } setCommitted(true); currentUser.setJAASInfo(subject); return true; }
/** * Read contents of the configured property file. * * @see javax.security.auth.spi.LoginModule#initialize(javax.security.auth.Subject, javax.security.auth.callback.CallbackHandler, java.util.Map, * java.util.Map) * @param subject * @param callbackHandler * @param sharedState * @param options */ public void initialize(Subject subject, CallbackHandler callbackHandler, Map<String, ?> sharedState, Map<String, ?> options) { super.initialize(subject,callbackHandler,sharedState,options); setupPropertyUserStore(options); }
/** * @see javax.security.auth.spi.LoginModule#abort() * @throws LoginException */ public boolean abort() throws LoginException { this.currentUser = null; return (isAuthenticated() && isCommitted()); }
public void initialize(Subject subject, CallbackHandler callbackHandler, Map<String,?> sharedState, Map<String,?> options) { super.initialize(subject, callbackHandler, sharedState, options); //get the user credential query out of the options dbUserTable = (String)options.get("userTable"); dbUserTableUserField = (String)options.get("userField"); dbUserTableCredentialField = (String)options.get("credentialField"); userQuery = "select "+dbUserTableCredentialField+" from "+dbUserTable+" where "+dbUserTableUserField+"=?"; //get the user roles query out of the options dbUserRoleTable = (String)options.get("userRoleTable"); dbUserRoleTableUserField = (String)options.get("userRoleUserField"); dbUserRoleTableRoleField = (String)options.get("userRoleRoleField"); rolesQuery = "select "+dbUserRoleTableRoleField+" from "+dbUserRoleTable+" where "+dbUserRoleTableUserField+"=?"; if(LOG.isDebugEnabled())LOG.debug("userQuery = "+userQuery); if(LOG.isDebugEnabled())LOG.debug("rolesQuery = "+rolesQuery); } }
public boolean abort() throws LoginException { try { _rootContext.close(); } catch (NamingException e) { throw new LoginException( "error closing root context: " + e.getMessage() ); } return super.abort(); }
public boolean commit() throws LoginException { try { _rootContext.close(); } catch (NamingException e) { throw new LoginException( "error closing root context: " + e.getMessage() ); } return super.commit(); }
public void initialize(Subject subject, CallbackHandler callbackHandler, Map<String,?> sharedState, Map<String,?> options) { super.initialize(subject, callbackHandler, sharedState, options); //get the user credential query out of the options dbUserTable = (String)options.get("userTable"); dbUserTableUserField = (String)options.get("userField"); dbUserTableCredentialField = (String)options.get("credentialField"); userQuery = "select "+dbUserTableCredentialField+" from "+dbUserTable+" where "+dbUserTableUserField+"=?"; //get the user roles query out of the options dbUserRoleTable = (String)options.get("userRoleTable"); dbUserRoleTableUserField = (String)options.get("userRoleUserField"); dbUserRoleTableRoleField = (String)options.get("userRoleRoleField"); rolesQuery = "select "+dbUserRoleTableRoleField+" from "+dbUserRoleTable+" where "+dbUserRoleTableUserField+"=?"; if(LOG.isDebugEnabled())LOG.debug("userQuery = "+userQuery); if(LOG.isDebugEnabled())LOG.debug("rolesQuery = "+rolesQuery); } }
Map<String,?> options) super.initialize(subject, callbackHandler, sharedState, options);
Map<String,?> options) super.initialize(subject, callbackHandler, sharedState, options);