Examples of AbstractEJBAuthorizationHelper


Examples of org.jboss.security.javaee.AbstractEJBAuthorizationHelper

      SecurityContext currentSC = SecurityActions.getSecurityContext();
      if (SecurityActions.getSecurityManagement(currentSC) == null)
         SecurityActions.setSecurityManagement(currentSC, securityManagement);

      AbstractEJBAuthorizationHelper authorizationHelper = SecurityHelperFactory.getEJBAuthorizationHelper(sc);
      authorizationHelper.setPolicyRegistration(container.getPolicyRegistration());

      isAuthorized = SecurityActions.authorize(authorizationHelper, ejbName, ejbMethod, mi.getPrincipal(),
            mi.getType().toInterfaceString(), ejbCS, caller, callerRunAsIdentity, container.getJaccContextID(),
            new SimpleRoleGroup(methodRoles));
View Full Code Here

Examples of org.jboss.security.javaee.AbstractEJBAuthorizationHelper

   {
      return AccessController.doPrivileged(new PrivilegedExceptionAction<Boolean>()
      {
         public Boolean run() throws Exception
         {
            AbstractEJBAuthorizationHelper helper = SecurityHelperFactory.getEJBAuthorizationHelper(sc);
            return helper.isCallerInRole(roleName,
                  ejbName, principal, contextSubject,
                  jaccContextID, securityRoleRefs);
         }
      });
   }
View Full Code Here

Examples of org.jboss.security.javaee.AbstractEJBAuthorizationHelper

         if(domain.unauthenticatedPrincipal() != null)
           callerPrincipal = new SimplePrincipal(unauth);            
      }
      else
      {
         AbstractEJBAuthorizationHelper helper;
         try
         {
            helper = SecurityHelperFactory.getEJBAuthorizationHelper(sc);
            helper.setPolicyRegistration(getPolicyRegistration());
         }
         catch (Exception e)
         {
            throw new RuntimeException(e);
         }
         callerPrincipal = helper.getCallerPrincipal();
      }
     
      if(callerPrincipal == null)
      {
         //try the incoming principal
View Full Code Here

Examples of org.jboss.security.javaee.AbstractEJBAuthorizationHelper

      for(SecurityRoleRefMetaData srmd: roleRefs)
      {
         srset.add(new SecurityRoleRef(srmd.getRoleName(),srmd.getRoleLink(),null));
      }
      Principal principal = getCallerPrincipal(sc, rm, domain);
      AbstractEJBAuthorizationHelper helper;
      try
      {
         helper = SecurityHelperFactory.getEJBAuthorizationHelper(sc);
         helper.setPolicyRegistration(getPolicyRegistration());
      }
      catch (Exception e)
      {
         throw new RuntimeException(e);
      }
      Subject callerSubject = null;
      try
      {
         callerSubject = SecurityActions.getActiveSubject();
      }
      catch (Exception e)
      {
         throw new RuntimeException(e);
      }
      return helper.isCallerInRole(roleName,
                                   ejbName,
                                   principal,
                                   callerSubject,
                                   this.getContextID(),
                                   srset);
View Full Code Here

Examples of org.jboss.security.javaee.AbstractEJBAuthorizationHelper

            String iface = (locator != null) ? "Remote" : "Local";
           
            RunAs callerRunAs = SecurityActions.peekRunAs();
           
            AbstractEJBAuthorizationHelper helper = null;
            try
            {
               helper = SecurityHelperFactory.getEJBAuthorizationHelper(sc);
            }
            catch(Exception e)
            {
               throw new RuntimeException(e);
            }
            boolean isAuthorized = helper.authorize(ejbName,
                             mi.getMethod(),
                             sc.getUtil().getUserPrincipal(),
                             iface,
                             ejbCS,
                             sc.getUtil().getSubject(),
View Full Code Here

Examples of org.jboss.security.javaee.AbstractEJBAuthorizationHelper

         if(domain.unauthenticatedPrincipal() != null)
           callerPrincipal = new SimplePrincipal(unauth);            
      }
      else
      {
         AbstractEJBAuthorizationHelper helper;
         try
         {
            helper = SecurityHelperFactory.getEJBAuthorizationHelper(sc);
            helper.setPolicyRegistration(getPolicyRegistration());
         }
         catch (Exception e)
         {
            throw new RuntimeException(e);
         }
         callerPrincipal = helper.getCallerPrincipal();
      }
     
      if(callerPrincipal == null)
      {
         //try the incoming principal
View Full Code Here

Examples of org.jboss.security.javaee.AbstractEJBAuthorizationHelper

      for(SecurityRoleRefMetaData srmd: roleRefs)
      {
         srset.add(new SecurityRoleRef(srmd.getRoleName(),srmd.getRoleLink(),null));
      }
      Principal principal = getCallerPrincipal(sc, rm, domain);
      AbstractEJBAuthorizationHelper helper;
      try
      {
         helper = SecurityHelperFactory.getEJBAuthorizationHelper(sc);
         helper.setPolicyRegistration(getPolicyRegistration());
      }
      catch (Exception e)
      {
         throw new RuntimeException(e);
      }
      Subject callerSubject = null;
      try
      {
         callerSubject = SecurityActions.getActiveSubject();
      }
      catch (Exception e)
      {
         throw new RuntimeException(e);
      }
      return helper.isCallerInRole(roleName,
                                   ejbName,
                                   principal,
                                   callerSubject,
                                   this.getContextID(),
                                   srset);
View Full Code Here

Examples of org.jboss.security.javaee.AbstractEJBAuthorizationHelper

     
      // if we have the security context, then try to
      // get the caller principal out of that
      if (sc != null)
      {
         AbstractEJBAuthorizationHelper helper;
         try
         {
            helper = SecurityHelperFactory.getEJBAuthorizationHelper(sc);
            helper.setPolicyRegistration(getPolicyRegistration());
         }
         catch (Exception e)
         {
            throw new RuntimeException(e);
         }
         callerPrincipal = helper.getCallerPrincipal();

         if (callerPrincipal == null)
         {
            //try the incoming principal
            callerPrincipal = sc.getUtil().getUserPrincipal();
View Full Code Here

Examples of org.jboss.security.javaee.AbstractEJBAuthorizationHelper

         if (srmd.getRoleLink() == null)
            continue;
         srset.add(new SecurityRoleRef(srmd.getRoleName(),srmd.getRoleLink(),null));
      }
      Principal principal = getCallerPrincipal(sc, rm, domain);
      AbstractEJBAuthorizationHelper helper;
      try
      {
         helper = SecurityHelperFactory.getEJBAuthorizationHelper(sc);
         helper.setPolicyRegistration(getPolicyRegistration());
      }
      catch (Exception e)
      {
         throw new RuntimeException(e);
      }
      Subject callerSubject = null;
      try
      {
         callerSubject = SecurityActions.getActiveSubject();
      }
      catch (Exception e)
      {
         throw new RuntimeException(e);
      }
      return helper.isCallerInRole(roleName,
                                   ejbName,
                                   principal,
                                   callerSubject,
                                   this.getContextID(),
                                   srset);
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.