Examples of SecurityDomainContext


Examples of org.jboss.as.security.plugins.SecurityDomainContext

     * @param securityDomain the name of the security domain
     * @return an instance of {@code SecurityDomainContext}
     * @throws Exception if an error occurs
     */
    private SecurityDomainContext lookupSecurityDomain(final JNDIBasedSecurityManagement securityManagement, final ConcurrentHashMap<String, SecurityDomainContext> securityManagerMap, final String securityDomain) throws Exception {
        SecurityDomainContext sdc = securityManagerMap.get(securityDomain);
        if (sdc == null) {
            sdc = securityManagement.createSecurityDomainContext(securityDomain);
            securityManagerMap.put(securityDomain, sdc);
        }
        return sdc;
View Full Code Here

Examples of org.jboss.as.security.plugins.SecurityDomainContext

            final String securityDomain = address.getLastElement().getValue();

            ServiceController<SecurityDomainContext> controller = getSecurityDomainService(context, securityDomain);
            if (controller != null) {
                waitFor(controller);
                SecurityDomainContext sdc = controller.getValue();
                @SuppressWarnings("unchecked")
                CacheableManager<?, Principal> manager = (CacheableManager<?, Principal>) sdc
                        .getAuthenticationManager();
                Set<Principal> cachedPrincipals = manager.getCachedKeys();
                ModelNode result = context.getResult();
                for (Principal principal : cachedPrincipals) {
                    result.add(principal.getName());
View Full Code Here

Examples of org.jboss.as.security.plugins.SecurityDomainContext

                principal = operation.get(Constants.PRINCIPAL_ARGUMENT).asString();

            ServiceController<SecurityDomainContext> controller = getSecurityDomainService(context, securityDomain);
            if (controller != null) {
                waitFor(controller);
                SecurityDomainContext sdc = controller.getValue();
                @SuppressWarnings("unchecked")
                CacheableManager<?, Principal> manager = (CacheableManager<?, Principal>) sdc.getAuthenticationManager();
                if (principal != null)
                    manager.flushCache(new SimplePrincipal(principal));
                else
                    manager.flushCache();
            } else {
View Full Code Here

Examples of org.jboss.as.security.plugins.SecurityDomainContext

            final String securityDomain = address.getLastElement().getValue();

            ServiceController<SecurityDomainContext> controller = getSecurityDomainService(context, securityDomain);
            if (controller != null) {
                waitFor(controller);
                SecurityDomainContext sdc = controller.getValue();
                @SuppressWarnings("unchecked")
                CacheableManager<?, Principal> manager = (CacheableManager<?, Principal>) sdc
                        .getAuthenticationManager();
                Set<Principal> cachedPrincipals = manager.getCachedKeys();
                ModelNode result = context.getResult();
                for (Principal principal : cachedPrincipals) {
                    result.add(principal.getName());
View Full Code Here

Examples of org.jboss.as.security.plugins.SecurityDomainContext

                principal = operation.get(Constants.PRINCIPAL_ARGUMENT).asString();

            ServiceController<SecurityDomainContext> controller = getSecurityDomainService(context, securityDomain);
            if (controller != null) {
                waitFor(controller);
                SecurityDomainContext sdc = controller.getValue();
                @SuppressWarnings("unchecked")
                CacheableManager<?, Principal> manager = (CacheableManager<?, Principal>) sdc.getAuthenticationManager();
                if (principal != null)
                    manager.flushCache(new SimplePrincipal(principal));
                else
                    manager.flushCache();
            } else {
View Full Code Here

Examples of org.jboss.as.security.plugins.SecurityDomainContext

      LoginConfig login = new LoginConfig("ApplicationRealm").addFirstAuthMethod(authMethod);
      deployment.setLoginConfig(login);
      deployment.addSecurityRole("REST");

      SecurityDomainContext securityDomainContext = securityDomainContextInjector.getValue();
      deployment.setIdentityManager(new JAASIdentityManagerImpl(securityDomainContext));

      // Commented waiting for WFLY-2553
      /*if ("SPNEGO".equals(authMethod)) {
         context.addValve(new NegotiationAuthenticator());
View Full Code Here

Examples of org.jboss.security.plugins.SecurityDomainContext

            log.trace("Running authentication cache flush thread");
         // scan all security domains
         for (Entry<String, SecurityDomainContext> entry : securityMgrMap.entrySet())
         {
            String securityDomain = entry.getKey();
            SecurityDomainContext securityDomainCtx = entry.getValue();
            CachePolicy cache = securityDomainCtx.getAuthenticationCache();
            AuthenticationTimedCachePolicy timedCache = null;
            if (cache instanceof TimedCachePolicy)
            {
               timedCache = (AuthenticationTimedCachePolicy) cache;
            }
View Full Code Here

Examples of org.jboss.security.plugins.SecurityDomainContext

         if( args[0] instanceof String )
            name = parser.parse((String) args[0]);
         else
            name = (Name)args[0];
         securityDomain = name.get(0);
         SecurityDomainContext val = (SecurityDomainContext)args[1];
         JNDIBasedSecurityManagement.securityMgrMap.put(securityDomain, val);
         return obj;
      }
      if( methodName.equals("lookup") == false )
         throw new OperationNotSupportedException("Only lookup is supported, op="+method);
      if( args[0] instanceof String )
         name = parser.parse((String) args[0]);
      else
         name = (Name)args[0];
      securityDomain = name.get(0);
      SecurityDomainContext securityDomainCtx = lookupSecurityDomain(securityDomain);
      //TODO: Legacy expectation was subjectsecuritymgr
      Object binding = securityDomainCtx.getSecurityManager();
      // Look for requests against the security domain context
      if( name.size() == 2 )
      {
         String request = name.get(1);
         binding = securityDomainCtx.lookup(request);
      }
      return binding;
   }
View Full Code Here

Examples of org.jboss.security.plugins.SecurityDomainContext

   }
  
   private SecurityDomainContext lookupSecurityDomain(String securityDomain)
   throws Exception
   {
      SecurityDomainContext sdc = (SecurityDomainContext) JNDIBasedSecurityManagement.securityMgrMap.get(securityDomain);
      if( sdc == null )
      {
         sdc = securityManagement.createSecurityDomainContext(securityDomain);
         JNDIBasedSecurityManagement.securityMgrMap.put(securityDomain, sdc);
      }
View Full Code Here

Examples of org.jboss.security.plugins.SecurityDomainContext

   @param timeoutInSecs - the cache timeout in seconds.
   @param resInSecs - resolution of timeouts in seconds.
   */
  public static void setCacheTimeout(String securityDomain, int timeoutInSecs, int resInSecs)
  {
     SecurityDomainContext securityDomainCtx = (SecurityDomainContext) securityMgrMap.get(securityDomain);
     if(securityDomainCtx == null)
     {
      try
      {
         String lookupStr = SecurityConstants.JAAS_CONTEXT_ROOT + "/" + securityDomain;
         securityDomainCtx = (SecurityDomainContext) new InitialContext().lookup(lookupStr);
         securityMgrMap.put(securityDomain, securityDomainCtx);
      }
      catch (NamingException e)
      {
         log.trace("SetCacheTimeOut:Failed to look up SecurityDomainCtx:"+securityDomain);
     
     }
     if(securityDomainCtx != null)
     {
        CachePolicy cache = securityDomainCtx.getAuthenticationCache();
        if( cache != null && cache instanceof TimedCachePolicy )
        {
           TimedCachePolicy tcp = (TimedCachePolicy) cache;
           synchronized( tcp )
           {
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.