Examples of ApplicationPolicy


Examples of org.jboss.security.config.ApplicationPolicy

    *
    * @return the parsed AuthenticationInfo object
    */
   public BaseAuthenticationInfo getAuthenticationInfo(String domainName)
   {
      ApplicationPolicy aPolicy = getApplicationPolicy(domainName);
      return aPolicy != null ? aPolicy.getAuthenticationInfo() : null;
   }
View Full Code Here

Examples of org.jboss.security.config.ApplicationPolicy

      xmlConfig.copy(config);
     
      // Add the config to SecurityConfiguration
      for (String cname : cnames)
      {
         ApplicationPolicy ap = config.get(cname);
         SecurityConfiguration.addApplicationPolicy(ap);
         handleJASPIDelegation(ap);
      }

   }
View Full Code Here

Examples of org.jboss.security.config.ApplicationPolicy

         log.trace("newChild.PolicyConfig, localName: " + localName);
      if ("application-policy".equals(localName))
      {
         String name = attrs.getValue("name");
         name = StringPropertyReplacer.replaceProperties(name);
         ApplicationPolicy aPolicy = new ApplicationPolicy(name);
         aPolicy.setPolicyConfig(config);
         String baseAppPolicyName = attrs.getValue("extends");
         if (baseAppPolicyName != null)
            aPolicy.setBaseApplicationPolicyName(baseAppPolicyName);
         if (trace)
            log.trace("newChild.PolicyConfig, AuthenticationInfo: " + name);
         child = aPolicy;
      }
      return child;
View Full Code Here

Examples of org.jboss.security.config.ApplicationPolicy

   private void initializeModules() throws Exception
   {
      //Clear the modules
      modules.clear();
      //Get the Configuration
      ApplicationPolicy aPolicy = SecurityConfiguration.getApplicationPolicy( securityDomain);
      if(aPolicy == null)
         throw new IllegalStateException("ApplicationPolicy not found for "+ securityDomain);
     
      IdentityTrustInfo iti = aPolicy.getIdentityTrustInfo();
      if(iti == null)
         return;
      IdentityTrustModuleEntry[] itmearr = iti.getIdentityTrustModuleEntry();
      for(IdentityTrustModuleEntry itme: itmearr)
      {
View Full Code Here

Examples of org.jboss.security.config.ApplicationPolicy

      return overallDecision;
   }

   private ACLInfo getACLInfo(String domainName, Resource resource)
   {
      ApplicationPolicy aPolicy = SecurityConfiguration.getApplicationPolicy(domainName);

      if (aPolicy == null)
      {
         if (trace)
            log.trace("Application Policy not obtained for domain=" + domainName
                  + ". Trying to obtain the App policy for the default domain of the layer:");
         aPolicy = SecurityConfiguration.getApplicationPolicy(resource.getLayer().name());
      }
      if (aPolicy == null)
         throw new IllegalStateException("Application Policy is null for domain:" + domainName);

      return aPolicy.getAclInfo();
   }
View Full Code Here

Examples of org.jboss.security.config.ApplicationPolicy

    * @see SecurityContext#getMappingContext(String)
    */
   public <T> MappingContext<T> getMappingContext(Class<T> mappingType)
   {
      //Apply Mapping Logic 
      ApplicationPolicy aPolicy = SecurityConfiguration.getApplicationPolicy(securityDomain);
     
      if(aPolicy == null)
      {
         String defaultDomain = SecurityConstants.DEFAULT_APPLICATION_POLICY;
         if(trace)
            log.trace("Application Policy not found for domain=" + securityDomain +
                  ".Mapping framework will use the default domain:" + defaultDomain);
         aPolicy = SecurityConfiguration.getApplicationPolicy(defaultDomain);
      }
      if(aPolicy == null )
         throw new IllegalStateException("Application Policy is null for the security domain:"
               + securityDomain);
     
      MappingContext<T> mc = null;
      MappingInfo rmi = aPolicy.getMappingInfo(mappingType);
     
      if(rmi != null)
      {
         MappingModuleEntry[] mpe = rmi.getMappingModuleEntry();
         ArrayList<MappingProvider<T>> al = new ArrayList<MappingProvider<T>>();
View Full Code Here

Examples of org.jboss.security.config.ApplicationPolicy

    * @throws Exception if an error occurs while registering the application policy.
    */
   public void start() throws Exception
   {
      // create the application policy using the information from the beans and push it to the security layer.
      ApplicationPolicy policy = this.getApplicationPolicy();
      logger.trace("ApplicationPolicy " + this.name + " created " + policy);

      ApplicationPolicyRegistration policyRegistration = XMLLoginConfigImpl.getInstance();
      policyRegistration.addApplicationPolicy(this.name, policy);

View Full Code Here

Examples of org.jboss.security.config.ApplicationPolicy

    *
    * @return a reference to the constructed {@code ApplicationPolicy} object.
    */
   public ApplicationPolicy getApplicationPolicy()
   {
      ApplicationPolicy policy = new ApplicationPolicy(this.name);
      policy.setBaseApplicationPolicyName(this.parentPolicy);
      if (this.authenticationPolicy != null)
         policy.setAuthenticationInfo(this.authenticationPolicy.getPolicyInfo(this.name));
      if (this.authorizationPolicy != null)
         policy.setAuthorizationInfo(this.authorizationPolicy.getPolicyInfo(this.name));
      if (this.aclPolicy != null)
         policy.setAclInfo(this.aclPolicy.getPolicyInfo(this.name));
      if (this.roleMappingPolicy != null)
      {
         Map<String,MappingInfo> infosByType = this.roleMappingPolicy.getMappingInfoByType(this.name);
         for(String type : infosByType.keySet())
            policy.setMappingInfo(type, infosByType.get(type));
      }
      if (this.mappingPolicy != null)
      {
         Map<String,MappingInfo> infosByType = this.mappingPolicy.getMappingInfoByType(this.name);
         for(String type : infosByType.keySet())
            policy.setMappingInfo(type, infosByType.get(type));
      }
      if (this.auditPolicy != null)
         policy.setAuditInfo(this.auditPolicy.getPolicyInfo(this.name));
      if (this.identityTrustPolicy != null)
         policy.setIdentityTrustInfo(this.identityTrustPolicy.getPolicyInfo(this.name));

      return policy;
   }
View Full Code Here

Examples of org.jboss.security.config.ApplicationPolicy

  
   private void initializeModules() throws Exception
   {
      String securityDomain = this.securityContext.getSecurityDomain();
      //Get the Configuration
      ApplicationPolicy aPolicy = SecurityConfiguration.getApplicationPolicy( securityDomain);
      if(aPolicy == null)
         throw new IllegalStateException("ApplicationPolicy not found for "+ securityDomain);
     
      IdentityTrustInfo iti = aPolicy.getIdentityTrustInfo();
      IdentityTrustModuleEntry[] itmearr = iti.getIdentityTrustModuleEntry();
      for(IdentityTrustModuleEntry itme: itmearr)
      {
         ControlFlag cf = itme.getControlFlag();
         if(cf == null)
View Full Code Here

Examples of org.jboss.security.config.ApplicationPolicy

        return AuthSubsystemAdd.TORQUEBOX_DOMAIN + "-" + this.getApplicationName();
    }

    private ServiceController<SecurityDomainContext> addTorqueBoxSecurityDomainService(DeploymentPhaseContext context, TorqueBoxAuthConfig config) {
        String domain = this.getTorqueBoxDomainServiceName();
        final ApplicationPolicy applicationPolicy = new ApplicationPolicy( domain );
        AuthenticationInfo authenticationInfo = new AuthenticationInfo( domain );

        Map<String, Object> options = new HashMap<String, Object>();
        Map<String, String> credentials = config.getCredentials();
        if (credentials != null) {
            options.put( "credentials", credentials );
        }
        AppConfigurationEntry entry = new AppConfigurationEntry( TorqueBoxLoginModule.class.getName(), LoginModuleControlFlag.REQUIRED, options );
        authenticationInfo.addAppConfigurationEntry( entry );
        applicationPolicy.setAuthenticationInfo( authenticationInfo );

        final SecurityDomainService securityDomainService = new SecurityDomainService( domain, applicationPolicy, null, null );
        final ServiceTarget target = context.getServiceTarget();

        ServiceBuilder<SecurityDomainContext> builder = target
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.