Package org.jboss.security

Examples of org.jboss.security.RealmMapping


    * Naming Context
    * @return
    */
   private RealmMapping getRealmMapping()
   {
      RealmMapping realmMapping = null;
      Context securityCtx = getSecurityNamingContext();
      if (securityCtx == null)
      {
         if (trace)
         {
View Full Code Here


    public AuthenticationManager getAuthenticationManager() {
        return authenticationMgr;
    }

    public RealmMapping getRealmMapping() {
        RealmMapping realmMapping = null;
        if (authorizationMgr != null && authorizationMgr instanceof RealmMapping) {
            realmMapping = (RealmMapping) authorizationMgr;
        } else if (authenticationMgr instanceof RealmMapping) {
            realmMapping = (RealmMapping) authenticationMgr;
        }
View Full Code Here

   {
      return securityMgr;
   }
   public RealmMapping getRealmMapping()
   {
      RealmMapping realmMapping = null;
      if(authorizationMgr != null && authorizationMgr instanceof RealmMapping)
      {
         realmMapping = (RealmMapping)authorizationMgr;
      }
      else
View Full Code Here

   {
      return securityMgr;
   }
   public RealmMapping getRealmMapping()
   {
      RealmMapping realmMapping = null;
      if(authorizationMgr != null && authorizationMgr instanceof RealmMapping)
      {
         realmMapping = (RealmMapping)authorizationMgr;
      }
      else
View Full Code Here

      {
         EJBContainer ec = (EJBContainer) container;
        
         Principal callerPrincipal = null;
        
         RealmMapping rm = container.getSecurityManager(RealmMapping.class);
        
         SecurityContext sc = SecurityContextAssociation.getSecurityContext();
         if(sc == null)
         {
            SecurityDomain domain =(SecurityDomain)ec.resolveAnnotation(SecurityDomain.class);
            String unauth = domain.unauthenticatedPrincipal();
            if(unauth != null && unauth.length() > 0)
            if(domain.unauthenticatedPrincipal() != null)
              callerPrincipal = new SimplePrincipal(unauth);            
         }
         else
         {
            EJBAuthorizationHelper helper = new EJBAuthorizationHelper(sc);
            callerPrincipal = helper.getCallerPrincipal(rm);
         }
        
         if(callerPrincipal == null)
         {
            //try the incoming principal
            callerPrincipal = sc.getUtil().getUserPrincipal();
            if(rm != null)
               callerPrincipal = rm.getPrincipal(callerPrincipal);
         }
        
         if(callerPrincipal == null)
         {
            SecurityDomain domain =(SecurityDomain)ec.resolveAnnotation(SecurityDomain.class);
View Full Code Here

      catch (NamingException e)
      {
         throw new RuntimeException(e);
      }
      AuthenticationManager manager = (AuthenticationManager) domain;
      RealmMapping mapping = (RealmMapping) domain;
      if (manager == null) throw new RuntimeException("Unable to find Security Domain");
      //return new RoleBasedAuthorizationInterceptor(manager, mapping, container);
      CodeSource ejbCS = advisor.getClazz().getProtectionDomain().getCodeSource();
      String ejbName = ((EJBContainer)advisor).getEjbName();
      return new RoleBasedAuthorizationInterceptorv2(container, ejbCS, ejbName);
View Full Code Here

     
      Interceptor interceptor = new NullInterceptor();
      if (domain != null)
      {
         AuthenticationManager manager = (AuthenticationManager) domain;
         RealmMapping mapping = (RealmMapping) domain;
         //interceptor = new RunAsSecurityInterceptor(manager, mapping, getRunAsIdentity(container));
        
         interceptor = new RunAsSecurityInterceptorv2(container, getRunAsIdentity(container));
      }
      return interceptor;
View Full Code Here

   {
      return securityMgr;
   }
   public RealmMapping getRealmMapping()
   {
      RealmMapping realmMapping = null;
      if(authorizationMgr != null && authorizationMgr instanceof RealmMapping)
      {
         realmMapping = (RealmMapping)authorizationMgr;
      }
      else
View Full Code Here

            SecurityDomainContext sdc = (SecurityDomainContext) iniCtx.lookup(domainCtx);
            Object securityMgr = sdc.getSecurityManager();

            // Object securityMgr = iniCtx.lookup(confSecurityDomain);
            AuthenticationManager ejbS = (AuthenticationManager) securityMgr;
            RealmMapping rM = (RealmMapping) securityMgr;
            container.setSecurityManager(ejbS);
            container.setRealmMapping(rM);

            container.setSecurityManagement(securityManagement);
            container.setPolicyRegistration(policyRegistration);
View Full Code Here

       */
      Principal getCallerPrincipalInternal()
      {
         if( beanPrincipal == null )
         {   
            RealmMapping rm = con.getRealmMapping();
            SecurityContext sc = SecurityActions.getSecurityContext();
            Principal caller = null;
            try
            {
               caller = SecurityHelperFactory.getEJBAuthorizationHelper(sc).getCallerPrincipal();
            }
            catch (Exception e)
            {
               log.error("Error getting callerPrincipal for " + con.getBeanClass(),e);
            }
           
            /* Apply any domain caller mapping. This should really only be
            done for non-run-as callers.
            */
            if (rm != null)
               caller = rm.getPrincipal(caller);
            
            if( caller == null )
            {
               /* Try the incoming request principal. This is needed if a client
               clears the current caller association and and an interceptor calls
               getCallerPrincipal as the call stack unwinds.
               */
               if( principal != null )
               {
                 if( rm != null )
                    caller = rm.getPrincipal(principal);
                 else
                    caller = principal;
               }
               // Check for an unauthenticated principal value
               else
View Full Code Here

TOP

Related Classes of org.jboss.security.RealmMapping

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.