Example #1
0
  /**
   * Update the AuthService global and organization settings. most of the code is moved in from
   * AuthenticatorManager.java.
   *
   * @param scm <code>ServiceSchemaManager</code> to be used for update
   * @throws SMSException if it fails to update auth service
   * @throws Exception
   */
  synchronized void updateAuthServiceGlobals(ServiceSchemaManager scm)
      throws SMSException, Exception {

    ServiceSchema schema = scm.getOrganizationSchema();
    Map attrs = schema.getAttributeDefaults();

    // get Global type attributes for iPlanetAMAuthService
    schema = scm.getGlobalSchema();

    attrs.putAll(schema.getAttributeDefaults());
    if (debug.messageEnabled()) {
      debug.message("attrs : " + attrs);
    }

    defaultAuthLocale = CollectionHelper.getMapAttr(attrs, ISAuthConstants.AUTH_LOCALE_ATTR);
    adminAuthModule = CollectionHelper.getMapAttr(attrs, ISAuthConstants.ADMIN_AUTH_MODULE);
    defaultAuthLevel =
        CollectionHelper.getMapAttr(attrs, ISAuthConstants.DEFAULT_AUTH_LEVEL, DEFAULT_AUTH_LEVEL);

    Set s = (Set) attrs.get(ISAuthConstants.AUTHENTICATORS);
    Iterator iter = s.iterator();
    while (iter.hasNext()) {
      String name = (String) iter.next();
      int dot = name.lastIndexOf('.');
      if (dot > -1) {
        String tmp = name.substring(dot + 1, name.length());
        authMethods.put(tmp, name);
      } else {
        authMethods.put(name, name);
      }
    }
    if (debug.messageEnabled()) {
      debug.message("AM.update authMethods = " + authMethods.toString());
    }

    defaultSuccessURLSet = (Set) attrs.get(ISAuthConstants.LOGIN_SUCCESS_URL);
    defaultFailureURLSet = (Set) attrs.get(ISAuthConstants.LOGIN_FAILURE_URL);

    if (debug.messageEnabled()) {
      debug.message("Default Success URL Set = " + defaultSuccessURLSet);
      debug.message("Default Failure URL Set = " + defaultFailureURLSet);
    }

    Integer sleepTime =
        new Integer(CollectionHelper.getMapAttr(attrs, ISAuthConstants.SLEEP_INTERVAL));
    defaultSleepTime = sleepTime.longValue();
  }
Example #2
0
  /**
   * Update the PlatformService global attributes.
   *
   * @param scm <code>ServiceSchemaManager</code> to be used for update
   * @throws SMSException if it fails to initialize platform service
   */
  synchronized void updatePlatformServiceGlobals(ServiceSchemaManager scm) throws SMSException {
    platformSchema = scm.getGlobalSchema();
    Map attrs = platformSchema.getAttributeDefaults();

    platformLocale = CollectionHelper.getMapAttr(attrs, ISAuthConstants.PLATFORM_LOCALE_ATTR);

    if (debug.messageEnabled()) {
      debug.message("PlatformLocale = " + platformLocale);
    }
  }
Example #3
0
 private void detectMode(String service, String attribute) {
   try {
     ServiceSchema schema = schemaManager.getGlobalSchema();
     Map defaults = schema.getAttributeDefaults();
     enabled = Boolean.parseBoolean(CollectionHelper.getMapAttr(defaults, attribute, ""));
     if (listenerId == null) {
       listenerId = schemaManager.addListener(this);
     }
   } catch (SMSException e) {
     DEBUG.error("Could not get " + service, e);
     throw new IllegalStateException("Could not get " + service, e);
   }
 }
Example #4
0
  /**
   * Update the AuthConfiguration organization attributes.
   *
   * @param scm <code>ServiceSchemaManager</code> to be used for update
   * @throws SMSException if it fails to update auth service
   */
  synchronized void updateAuthConfigGlobals(ServiceSchemaManager scm) throws SMSException {

    ServiceSchema schema = scm.getOrganizationSchema();

    schema = schema.getSubSchema("Configurations");
    schema = schema.getSubSchema("NamedConfiguration");
    Map attrs = schema.getAttributeDefaults();

    if (attrs != null) {
      defaultServiceSuccessURLSet = (Set) attrs.get(ISAuthConstants.LOGIN_SUCCESS_URL);
      defaultServiceFailureURLSet = (Set) attrs.get(ISAuthConstants.LOGIN_FAILURE_URL);
    }
    if (debug.messageEnabled()) {
      debug.message("Default Service Success URL Set = " + defaultServiceSuccessURLSet);
      debug.message("Default Service Failure URL Set = " + defaultServiceFailureURLSet);
    }
  }
Example #5
0
  /**
   * Update the SessionService dynamic attributes.
   *
   * @param scm <code>ServiceSchemaManager</code> to be used for update
   * @throws SMSException if it fails to update session service
   */
  synchronized void updateSessionServiceDynamics(ServiceSchemaManager scm) throws SMSException {

    sessionSchema = scm.getDynamicSchema();
    if (debug.messageEnabled()) {
      Map attrs = sessionSchema.getAttributeDefaults();
      String defaultMaxSessionTime =
          CollectionHelper.getMapAttr(attrs, ISAuthConstants.MAX_SESSION_TIME, "120");
      String defaultMaxIdleTime =
          CollectionHelper.getMapAttr(attrs, ISAuthConstants.SESS_MAX_IDLE_TIME, "30");
      String defaultMaxCachingTime =
          CollectionHelper.getMapAttr(attrs, ISAuthConstants.SESS_MAX_CACHING_TIME, "3");
      debug.message(
          "AuthD.defaultMaxSessionTime="
              + defaultMaxSessionTime
              + "\nAuthD.defaultMaxIdleTime="
              + defaultMaxIdleTime
              + "\nAuthD.defaultMaxCachingTime="
              + defaultMaxCachingTime);
    }
  }
Example #6
0
 /**
  * Return max session caching time
  *
  * @return max session caching time
  */
 String getDefaultMaxCachingTime() {
   return CollectionHelper.getMapAttr(
       sessionSchema.getAttributeDefaults(), ISAuthConstants.SESS_MAX_CACHING_TIME, "3");
 }
Example #7
0
 /**
  * Return max session idle time
  *
  * @return max session idle time
  */
 String getDefaultMaxIdleTime() {
   return CollectionHelper.getMapAttr(
       sessionSchema.getAttributeDefaults(), ISAuthConstants.SESS_MAX_IDLE_TIME, "30");
 }
Example #8
0
 /**
  * Return max session time
  *
  * @return max session time
  */
 String getDefaultMaxSessionTime() {
   return CollectionHelper.getMapAttr(
       sessionSchema.getAttributeDefaults(), ISAuthConstants.MAX_SESSION_TIME, "120");
 }