Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * JBoss, Home of Professional Open Source
   * Copyright 2005, JBoss Inc., and individual contributors as indicated
   * by the @authors tag. See the copyright.txt in the distribution for a
   * full listing of individual contributors.
   *
   * This is free software; you can redistribute it and/or modify it
   * under the terms of the GNU Lesser General Public License as
   * published by the Free Software Foundation; either version 2.1 of
  * the License, or (at your option) any later version.
  *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this software; if not, write to the Free
  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
  */
 package org.jboss.security.auth.login;
 
 import java.util.List;
 
 
 import  org.jboss.security.SecurityConstants;
 import  org.jboss.security.config.BaseSecurityInfo;
 
 // $Id: BaseAuthenticationInfo.java 2 2010-02-09 17:42:37Z  $
 
Base for AuthenticationInfo(JAAS) and JASPIAuthenticationInfo(JSR-196)

Author(s):
Anil.Saldhana@jboss.org
Since:
Dec 21, 2005
 
 public class BaseAuthenticationInfo extends BaseSecurityInfo<Object>
 {
    public BaseAuthenticationInfo()
    {
       super();
    }
 
    public BaseAuthenticationInfo(String name)
    {
       super(name);
    }
 
    @Override
    protected BaseSecurityInfo<Objectcreate(String name)
    {
       return new BaseAuthenticationInfo(name);
    }

   

Gets the application authentication configuration. Execution of this method requires a getLoginConfiguration permission.

Returns:
an AppConfigurationEntry array containing the application's authentication configuration.
 
    {
       SecurityManager sm = System.getSecurityManager();
       if (sm != null)
          sm.checkPermission(GET_CONFIG_ENTRY_PERM);
       AppConfigurationEntry[] entries = new AppConfigurationEntry[super.moduleEntries.size()];
       super.moduleEntries.toArray(entries);
       return entries;
    }

   

Creates and returns a copy of the application authentication configuration. By default this returns the array created by the copyAppConfigurationEntry(List) method using the moduleEntries as a parameter.

Returns:
an AppConfigurationEntry array containing the copied entries.
 
    {
       return this.copyAppConfigurationEntry(super.moduleEntries);
    }

   

Creates and returns a copy of the specified list of AppConfigurationEntry objects, adding the security domain option when necessary. Execution of this method requires a getLoginConfiguration permission.

Parameters:
entries a List containing the AppConfigurationEntry objects to be copied.
Returns:
an AppConfigurationEntry array containing the copied entries.
   {
      SecurityManager sm = System.getSecurityManager();
      if (sm != null)
         sm.checkPermission(GET_CONFIG_ENTRY_PERM);
      AppConfigurationEntry[] copy = new AppConfigurationEntry[entries.size()];
      for (int i = 0; i < copy.lengthi++)
      {
         AppConfigurationEntry entry = (AppConfigurationEntryentries.get(i);
         HashMap<StringObjectoptions = new HashMap<StringObject>(entry.getOptions());
         if (!disableSecurityDomainInOptions())
         {
            options.put(SecurityConstants.SECURITY_DOMAIN_OPTION, this.getName());
         }
         copy[i] = new AppConfigurationEntry(entry.getLoginModuleName(), entry.getControlFlag(), options);
      }
      return copy;
   }

   

Checks whether the jboss.security.disable.secdomain.option system property has been specified with a value of true or not.

Returns:
true if the jboss.security.disable.secdomain.option=true has been specified; false otherwise.
   private boolean disableSecurityDomainInOptions()
   {
      String sysprop = AccessController.doPrivileged(new PrivilegedAction<String>()
      {
         public String run()
         {
            return System.getProperty(SecurityConstants.DISABLE_SECDOMAIN_OPTION);
         }
      });
      return "true".equalsIgnoreCase(sysprop);
   }
New to GrepCode? Check out our FAQ X