/** * Compares a realm to another. The comparison first considers the * authentication type, so that realms supporting the same kind of * user authentication are grouped together. Then it compares realm * realm names. Realms compare "before" other kinds of objects (i.e. * there's only a partial order defined, in the case that those other * objects compare themselves "before" a realm object). */ public int compareTo (Object realm) { if (!(realm instanceof Realm)) { return 1; } Realm r = (Realm) realm; String str = r.getAuthType (); int temp; if ((temp = getAuthType ().compareTo (str)) != 0) { return temp; } str = r.getName (); return getName ().compareTo (str); }
/** * Compares a realm to another. The comparison first considers the * authentication type, so that realms supporting the same kind of * user authentication are grouped together. Then it compares realm * realm names. Realms compare "before" other kinds of objects (i.e. * there's only a partial order defined, in the case that those other * objects compare themselves "before" a realm object). */ public int compareTo (Object realm) { if (!(realm instanceof Realm)) { return 1; } Realm r = (Realm) realm; String str = r.getAuthType (); int temp; if ((temp = getAuthType ().compareTo (str)) != 0) { return temp; } str = r.getName (); return getName ().compareTo (str); }
/** * Compares a realm to another. The comparison first considers the * authentication type, so that realms supporting the same kind of * user authentication are grouped together. Then it compares realm * realm names. Realms compare "before" other kinds of objects (i.e. * there's only a partial order defined, in the case that those other * objects compare themselves "before" a realm object). */ public int compareTo (Object realm) { if (!(realm instanceof Realm)) { return 1; } Realm r = (Realm) realm; String str = r.getAuthType (); int temp; if ((temp = getAuthType ().compareTo (str)) != 0) { return temp; } str = r.getName (); return getName ().compareTo (str); }
/** * Replace a Realm instance. Can be used by a Realm subclass to * replace a previously initialized instance of itself. Future * getInstance requests will then obtain the new instance. * * <P>Minimal error checking is done. The realm being replaced must * already exist (instantiate() was previously called), the new * instance must be fully initialized properly and it must of course * be of the same class as the previous instance. * * @param realm The new realm instance. * @param name The (previously instantiated) name for this realm. * */ protected static synchronized void updateInstance(String configName, Realm realm, String name) { RealmsManager mgr = getRealmsManager(); if (mgr == null) { throw new RuntimeException("Unable to locate RealmsManager Service"); } Realm oldRealm = mgr.getFromLoadedRealms(configName, name); if (!oldRealm.getClass().equals(realm.getClass())) { // would never happen unless bug in realm subclass throw new Error("Incompatible class " + realm.getClass() + " in replacement realm " + name); } realm.setName(oldRealm.getName()); mgr.putIntoLoadedRealms(configName, name, realm); _logger.log(Level.INFO, SecurityLoggerInfo.realmUpdated, new Object[]{realm.getName()}); }
/** * Replace a Realm instance. Can be used by a Realm subclass to * replace a previously initialized instance of itself. Future * getInstance requests will then obtain the new instance. * * <P>Minimal error checking is done. The realm being replaced must * already exist (instantiate() was previously called), the new * instance must be fully initialized properly and it must of course * be of the same class as the previous instance. * * @param realm The new realm instance. * @param name The (previously instantiated) name for this realm. * */ protected static synchronized void updateInstance(String configName, Realm realm, String name) { RealmsManager mgr = getRealmsManager(); if (mgr == null) { throw new RuntimeException("Unable to locate RealmsManager Service"); } Realm oldRealm = mgr.getFromLoadedRealms(configName, name); if (!oldRealm.getClass().equals(realm.getClass())) { // would never happen unless bug in realm subclass throw new Error("Incompatible class " + realm.getClass() + " in replacement realm " + name); } realm.setName(oldRealm.getName()); mgr.putIntoLoadedRealms(configName, name, realm); _logger.log(Level.INFO, "realm.updated.successfully", new Object[]{realm.getName()}); }
" in replacement realm "+name); realm.setName(oldRealm.getName()); mgr.putIntoLoadedRealms(name, realm);
/** Called at the end of the authenticate method by the user * @return AuthenticationStatus indicating success/failure */ public final AuthenticationStatus commitAuthentication(String username, char[] password, Realm theRealm, String[] groups) { commitUserAuthentication(groups); int status = AuthenticationStatus.AUTH_SUCCESS; String realm = theRealm.getName(); String authMethod = theRealm.getAuthType(); AuthenticationStatus as = new AuthenticationStatusImpl(username, authMethod, realm, status); return as; } abstract protected AuthenticationStatus authenticate() throws LoginException;
/** Called at the end of the authenticate method by the user * @return AuthenticationStatus indicating success/failure */ public final AuthenticationStatus commitAuthentication(String username, char[] password, Realm theRealm, String[] groups) { commitUserAuthentication(groups); int status = AuthenticationStatus.AUTH_SUCCESS; String realm = theRealm.getName(); String authMethod = theRealm.getAuthType(); AuthenticationStatus as = new AuthenticationStatusImpl(username, authMethod, realm, status); return as; } abstract protected AuthenticationStatus authenticate() throws LoginException;
String realm_name = _currentRealm.getName(); _userPrincipal = PrincipalGroupFactory.getPrincipalInstance(getUsername(),realm_name);
String realm_name = _currentRealm.getName(); PrincipalGroupFactory factory = Globals.getDefaultHabitat().getService(PrincipalGroupFactory.class); if (factory != null)
realm_name = realm.getName(); setSecurityContext(user, s, realm_name);
_logger.warning("certlogin.badrealm"); setSecurityContext(user, s, realm_name); realm_name = realm.getName();