/** * Returns the realm identified by the name which is passed * as a parameter. This function knows about all the realms * which exist; it is not possible to store (or create) one * which is not accessible through this routine. * * @param name identifies the realm * @return the requested realm * @exception NoSuchRealmException if the realm is invalid * @exception BadRealmException if realm data structures are bad */ public static synchronized Realm getInstance(String configName, String name) throws NoSuchRealmException { Realm retval = _getInstance(configName, name); if (retval == null) { throw new NoSuchRealmException( localStrings.getLocalString("realm.no_such_realm", name + " realm does not exist.", new Object[] { name })); } return retval; }
public final boolean login() throws LoginException { Set<Object> creds = this.subject.getPrivateCredentials(); Iterator<Object> itr = creds.iterator(); while (itr.hasNext()) { Object obj = itr.next(); if (obj instanceof DigestCredentials) { digestCredentials = (DigestCredentials) obj; break; } } DigestAlgorithmParameter [] params = digestCredentials.getParameters(); String username = digestCredentials.getUserName(); try { _realm = Realm.getInstance(digestCredentials.getRealmName()); } catch (NoSuchRealmException ex) { _logger.log(Level.FINE,"",ex); _logger.log(Level.SEVERE,"no.realm",digestCredentials.getRealmName()); throw new LoginException(ex.getMessage()); } if (_realm instanceof DigestRealm){ if(((DigestRealm)_realm).validate(username, params)) { //change to pass Password Validator _succeeded = true; } }else{ _logger.log(Level.SEVERE,"digest.realm",digestCredentials.getRealmName()); throw new LoginException("Realm" + digestCredentials.getRealmName()+ " does not support Digest validation"); } return _succeeded; }
_logger.warning("Realm " + realmName + ": " + ex.toString()); } catch (NoSuchRealmException ex) { LoginException lex = new LoginException(ex.toString()); lex.initCause(ex); throw lex;
fr = (FileRealm) realmsManager.getFromLoadedRealms(config.getName(),authRealmName); if (fr == null) { throw new NoSuchRealmException(authRealmName); "list.file.user.realmnotsupported", "Configured file realm {0} is not supported.", authRealmName) + " " + e.getLocalizedMessage()); report.setActionExitCode(ActionReport.ExitCode.FAILURE); report.setFailureCause(e);
"list.file.user.realmcorrupted", "Configured file realm {0} is corrupted.", authRealmName) + " " + e.getLocalizedMessage()); report.setActionExitCode(ActionReport.ExitCode.FAILURE); report.setFailureCause(e); "list.file.user.realmnotsupported", "Configured file realm {0} is not supported.", authRealmName) + " " + e.getLocalizedMessage()); report.setActionExitCode(ActionReport.ExitCode.FAILURE); report.setFailureCause(e);
fr = (FileRealm) realmsManager.getFromLoadedRealms(config.getName(),authRealmName); if (fr == null) { throw new NoSuchRealmException(authRealmName); "list.file.user.realmnotsupported", "Configured file realm {0} is not supported.", authRealmName) + " " + e.getLocalizedMessage()); report.setActionExitCode(ActionReport.ExitCode.FAILURE); report.setFailureCause(e);
"change.admin.password.realmcorrupted", "Configured admin realm is corrupted.") + " " + e.getLocalizedMessage()); report.setActionExitCode(ActionReport.ExitCode.FAILURE); report.setFailureCause(e); "change.admin.password.realmnotsupported", "Configured admin realm does not exist.") + " " + e.getLocalizedMessage()); report.setActionExitCode(ActionReport.ExitCode.FAILURE); report.setFailureCause(e);
fr = (FileRealm) realmsManager.getFromLoadedRealms(config.getName(),authRealmName); if (fr == null) { throw new NoSuchRealmException(authRealmName); "list.file.user.realmnotsupported", "Configured file realm {0} is not supported.", authRealmName) + " " + e.getLocalizedMessage()); report.setActionExitCode(ActionReport.ExitCode.FAILURE); report.setFailureCause(e);
"create.file.user.realmcorrupted", "Configured file realm {0} is corrupted.", authRealmName) + " " + e.getLocalizedMessage()); report.setActionExitCode(ActionReport.ExitCode.FAILURE); report.setFailureCause(e); "create.file.user.realmnotsupported", "Configured file realm {0} does not exist.", authRealmName) + " " + e.getLocalizedMessage()); report.setActionExitCode(ActionReport.ExitCode.FAILURE); report.setFailureCause(e);
/** * Returns the realm identified by the name which is passed * as a parameter. This function knows about all the realms * which exist; it is not possible to store (or create) one * which is not accessible through this routine. * * @param name identifies the realm * @return the requested realm * @exception NoSuchRealmException if the realm is invalid * @exception BadRealmException if realm data structures are bad */ public static Realm getInstance(String name) throws NoSuchRealmException { Realm retval = _getInstance(name); if (retval == null) { throw new NoSuchRealmException( localStrings.getLocalString("realm.no_such_realm", name + " realm does not exist.", new Object[] { name })); } return retval; }
_logger.log(Level.FINE,"",ex); _logger.log(Level.SEVERE,"no.realm",digestCredentials.getRealmName()); throw new LoginException(ex.getMessage());
_logger.log(Level.WARNING, SecurityLoggerInfo.noSuchUserInRealmError, new Object[] { username, realmName, ex.toString()}); } catch (NoSuchRealmException ex) { LoginException lex = new LoginException(ex.toString()); lex.initCause(ex); throw lex;
fr = (FileRealm) realmsManager.getFromLoadedRealms(config.getName(), fileAuthRealm.getName()); if (fr == null) { throw new NoSuchRealmException(fileAuthRealm.getName()); "change.admin.password.realmnotsupported", "Configured admin realm does not exist.") + " " + e.getLocalizedMessage()); report.setActionExitCode(ActionReport.ExitCode.FAILURE); report.setFailureCause(e);
"update.file.user.realmcorrupted", "Configured file realm {0} is corrupted.", authRealmName) + " " + e.getLocalizedMessage()); report.setActionExitCode(ActionReport.ExitCode.FAILURE); report.setFailureCause(e); "update.file.user.realmnotsupported", "Configured file realm {0} does not exist.", authRealmName) + " " + e.getLocalizedMessage()); report.setActionExitCode(ActionReport.ExitCode.FAILURE); report.setFailureCause(e);
/** * Returns the realm identified by the name which is passed * as a parameter. This function knows about all the realms * which exist; it is not possible to store (or create) one * which is not accessible through this routine. * * @param name identifies the realm * @return the requested realm * @exception NoSuchRealmException if the realm is invalid * @exception BadRealmException if realm data structures are bad */ public static synchronized Realm getInstance(String name) throws NoSuchRealmException { Realm retval = _getInstance(name); if (retval == null) { throw new NoSuchRealmException( localStrings.getLocalString("realm.no_such_realm", name + " realm does not exist.", new Object[] { name })); } return retval; }
fr = (FileRealm) realmsManager.getFromLoadedRealms(config.getName(),authRealmName); if (fr == null) { throw new NoSuchRealmException(authRealmName); "list.file.user.realmnotsupported", "Configured file realm {0} is not supported.", authRealmName) + " " + e.getLocalizedMessage()); report.setActionExitCode(ActionReport.ExitCode.FAILURE); report.setFailureCause(e);
"list.file.user.realmcorrupted", "Configured file realm {0} is corrupted.", authRealmName) + " " + e.getLocalizedMessage()); report.setActionExitCode(ActionReport.ExitCode.FAILURE); report.setFailureCause(e); "list.file.user.realmnotsupported", "Configured file realm {0} is not supported.", authRealmName) + " " + e.getLocalizedMessage()); report.setActionExitCode(ActionReport.ExitCode.FAILURE); report.setFailureCause(e);
/** * Returns the realm identified by the name which is passed * as a parameter. This function knows about all the realms * which exist; it is not possible to store (or create) one * which is not accessible through this routine. * * @param name identifies the realm * @return the requested realm * @exception NoSuchRealmException if the realm is invalid * @exception BadRealmException if realm data structures are bad */ public static synchronized Realm getInstance(String name) throws NoSuchRealmException { Realm retval = _getInstance(name); if (retval == null) { throw new NoSuchRealmException( localStrings.getLocalString("realm.no_such_realm", name + " realm does not exist.", new Object[] { name })); } return retval; }
fr = (FileRealm) realmsManager.getFromLoadedRealms(config.getName(), fileAuthRealm.getName()); if (fr == null) { throw new NoSuchRealmException(fileAuthRealm.getName()); "change.admin.password.realmnotsupported", "Configured admin realm does not exist.") + " " + e.getLocalizedMessage()); report.setActionExitCode(ActionReport.ExitCode.FAILURE); report.setFailureCause(e);
"delete.file.user.realmcorrupted", "Configured file realm {0} is corrupted.", authRealmName) + " " + e.getLocalizedMessage()); report.setActionExitCode(ActionReport.ExitCode.FAILURE); report.setFailureCause(e); "delete.file.user.realmnotsupported", "Configured file realm {0} is not supported.", authRealmName) + " " + e.getLocalizedMessage()); report.setActionExitCode(ActionReport.ExitCode.FAILURE); report.setFailureCause(e);