Package org.jboss.security.plugins.auth.JaasSecurityManagerBase

Examples of org.jboss.security.plugins.auth.JaasSecurityManagerBase.DomainInfo


    @return true if the principal was authenticated, false otherwise.
    */
   public boolean isValid(Principal principal, Object credential, Subject activeSubject)
   {
      // Check the cache first
      DomainInfo cacheInfo = getCacheInfo(principal, true);
      if (trace)
         log.trace("Begin isValid, principal:" + principal + ", cache info: " + cacheInfo);

      boolean isValid = false;
      if (principal != null && principal.getName() != null)
      {
         synchronized (principal.getName().intern())
         {
            if (cacheInfo != null)
            {
               isValid = validateCache(cacheInfo, credential, activeSubject);
               cacheInfo.release();
            }
            if (isValid == false)
               isValid = authenticate(principal, credential, activeSubject);
         }
      }
      else
      {
         if (cacheInfo != null)
            cacheInfo.release();
         isValid = authenticate(principal, credential, activeSubject);
      }
      if (trace)
         log.trace("End isValid, " + isValid);
      return isValid;
View Full Code Here


         return principal;
      Principal result = principal;
      // Get the CallerPrincipal group member
      synchronized (domainCache)
      {
         DomainInfo info = getCacheInfo(principal, false);
         if (trace)
            log.trace("getPrincipal, cache info: " + info);
         if (info != null)
         {
            result = info.callerPrincipal;
            // If the mapping did not have a callerPrincipal just use principal
            if (result == null)
               result = principal;
            info.release();
         }
      }

      return result;
   }
View Full Code Here

   private DomainInfo getCacheInfo(Principal principal, boolean allowRefresh)
   {
      if (domainCache == null)
         return null;

      DomainInfo cacheInfo = null;
      synchronized (domainCache)
      {
         if (allowRefresh == true)
            cacheInfo = (DomainInfo) domainCache.get(principal);
         else
            cacheInfo = (DomainInfo) domainCache.peek(principal);
         if (cacheInfo != null)
            cacheInfo.acquire();
      }
      return cacheInfo;
   }
View Full Code Here

      if (domainCache instanceof TimedCachePolicy)
      {
         TimedCachePolicy cache = (TimedCachePolicy) domainCache;
         lifetime = cache.getDefaultLifetime();
      }
      DomainInfo info = new DomainInfo(lifetime);
      info.loginCtx = lc;
      info.subject = new Subject();
      SubjectActions.copySubject(subject, info.subject, true, this.deepCopySubjectOption);
      info.credential = credential;
View Full Code Here

    @return true if the principal was authenticated, false otherwise.
    */
   public boolean isValid(Principal principal, Object credential, Subject activeSubject)
   {
      // Check the cache first
      DomainInfo cacheInfo = getCacheInfo(principal, true);
      if (trace)
         log.trace("Begin isValid, principal:" + principal + ", cache info: " + cacheInfo);

      boolean isValid = false;
      if (principal != null && principal.getName() != null)
      {
         synchronized (principal.getName().intern())
         {
            if (cacheInfo != null)
            {
               isValid = validateCache(cacheInfo, credential, activeSubject);
               cacheInfo.release();
            }
            if (isValid == false)
               isValid = authenticate(principal, credential, activeSubject);
         }
      }
      else
      {
         if (cacheInfo != null)
            cacheInfo.release();
         isValid = authenticate(principal, credential, activeSubject);
      }
      if (trace)
         log.trace("End isValid, " + isValid);
      return isValid;
View Full Code Here

         return principal;
      Principal result = principal;
      // Get the CallerPrincipal group member
      synchronized (domainCache)
      {
         DomainInfo info = getCacheInfo(principal, false);
         if (trace)
            log.trace("getPrincipal, cache info: " + info);
         if (info != null)
         {
            result = info.callerPrincipal;
            // If the mapping did not have a callerPrincipal just use principal
            if (result == null)
               result = principal;
            info.release();
         }
      }

      return result;
   }
View Full Code Here

   private DomainInfo getCacheInfo(Principal principal, boolean allowRefresh)
   {
      if (domainCache == null)
         return null;

      DomainInfo cacheInfo = null;
      synchronized (domainCache)
      {
         if (allowRefresh == true)
            cacheInfo = (DomainInfo) domainCache.get(principal);
         else
            cacheInfo = (DomainInfo) domainCache.peek(principal);
         if (cacheInfo != null)
            cacheInfo.acquire();
      }
      return cacheInfo;
   }
View Full Code Here

      if (domainCache instanceof TimedCachePolicy)
      {
         TimedCachePolicy cache = (TimedCachePolicy) domainCache;
         lifetime = cache.getDefaultLifetime();
      }
      DomainInfo info = new DomainInfo(lifetime);
      info.loginCtx = lc;
      info.subject = new Subject();
      SubjectActions.copySubject(subject, info.subject, true, this.deepCopySubjectOption);
      info.credential = credential;
View Full Code Here

TOP

Related Classes of org.jboss.security.plugins.auth.JaasSecurityManagerBase.DomainInfo

Copyright © 2018 www.massapicom. 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.