Package org.jboss.security.integration.ejb

Examples of org.jboss.security.integration.ejb.EJBAuthorizationHelper


            String iface = (locator != null) ? "Remote" : "Local";
           
            RunAsIdentity callerRunAs = SecurityActions.peekRunAsIdentity();
           
            EJBAuthorizationHelper helper = new EJBAuthorizationHelper(sc);
            boolean isAuthorized = helper.authorize(ejbName,
                             mi.getMethod(),
                             sc.getUtil().getUserPrincipal(),
                             iface,
                             ejbCS,
                             sc.getUtil().getSubject(),
View Full Code Here


            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
View Full Code Here

      for(SecurityRoleRefMetaData srmd: roleRefs)
      {
         srset.add(new SecurityRoleRef(srmd.getRoleName(),srmd.getRoleLink(),null));
      }
      Principal principal = getCallerPrincipal();
      EJBAuthorizationHelper helper = new EJBAuthorizationHelper(sc);
      return helper.isCallerInRole(roleName,
                                   ejbc.getEjbName(),
                                   principal,
                                   srset);
   }
View Full Code Here

/*     */     Principal getCallerPrincipalInternal()
/*     */     {
/* 368 */       if (EnterpriseContext.this.beanPrincipal == null)
/*     */       {
/* 370 */         RealmMapping rm = EnterpriseContext.this.con.getRealmMapping();
/* 371 */         EJBAuthorizationHelper helper = new EJBAuthorizationHelper(EnterpriseContext.this.securityContext);
/* 372 */         Principal caller = helper.getCallerPrincipal(rm);
/* 373 */         if (caller == null)
/*     */         {
/* 379 */           if (EnterpriseContext.this.principal != null)
/*     */           {
/* 381 */             if (rm != null)
View Full Code Here

/*     */       {
/* 525 */         if (EnterpriseContext.log.isTraceEnabled()) {
/* 526 */           EnterpriseContext.log.trace("PolicyContextException in getting caller subject:", pe);
/*     */         }
/*     */       }
/* 529 */       EJBAuthorizationHelper helper = new EJBAuthorizationHelper(EnterpriseContext.this.securityContext);
/* 530 */       String ejbName = EnterpriseContext.this.getContainer().getBeanMetaData().getEjbName();
/* 531 */       return helper.isCallerInRole(roleName, ejbName, EnterpriseContext.this.principal, securityRoleRefs);
/*     */     }
View Full Code Here

/* 166 */           (domain.unauthenticatedPrincipal() != null))
/* 167 */           callerPrincipal = new SimplePrincipal(unauth);
/*     */       }
/*     */       else
/*     */       {
/* 171 */         EJBAuthorizationHelper helper = new EJBAuthorizationHelper(sc);
/* 172 */         callerPrincipal = helper.getCallerPrincipal(rm);
/*     */       }
/*     */
/* 175 */       if (callerPrincipal == null)
/*     */       {
/* 178 */         callerPrincipal = sc.getUtil().getUserPrincipal();
View Full Code Here

/* 236 */     for (SecurityRoleRefMetaData srmd : roleRefs)
/*     */     {
/* 238 */       srset.add(new SecurityRoleRef(srmd.getRoleName(), srmd.getRoleLink(), null));
/*     */     }
/* 240 */     Principal principal = getCallerPrincipal();
/* 241 */     EJBAuthorizationHelper helper = new EJBAuthorizationHelper(sc);
/* 242 */     return helper.isCallerInRole(roleName, ejbc.getEjbName(), principal, srset);
/*     */   }
View Full Code Here

/*     */
/* 170 */         String iface = locator != null ? "Remote" : "Local";
/*     */
/* 172 */         RunAsIdentity callerRunAs = SecurityActions.peekRunAsIdentity();
/*     */
/* 174 */         EJBAuthorizationHelper helper = new EJBAuthorizationHelper(sc);
/* 175 */         boolean isAuthorized = helper.authorize(this.ejbName, mi.getMethod(), sc.getUtil().getUserPrincipal(), iface, this.ejbCS, sc.getUtil().getSubject(), callerRunAs, methodRoles);
/*     */
/* 183 */         if (!isAuthorized)
/* 184 */           throw new EJBAccessException("Caller unauthorized");
/*     */       }
/* 186 */       sc = invocation.invokeNext();
View Full Code Here

/* 337 */     Set methodRoles = this.container.getMethodPermissions(ejbMethod, mi.getType());
/*     */
/* 339 */     SecurityContext currentSC = SecurityActions.getSecurityContext();
/* 340 */     if (currentSC.getSecurityManagement() == null)
/* 341 */       currentSC.setSecurityManagement(this.securityManagement);
/* 342 */     EJBAuthorizationHelper eah = new EJBAuthorizationHelper(currentSC);
/* 343 */     isAuthorized = eah.authorize(this.ejbName, ejbMethod, mi.getPrincipal(), mi.getType().toInterfaceString(), this.ejbCS, caller, callerRunAsIdentity, methodRoles);
/*     */
/* 352 */     String msg = "Denied: caller with subject=" + caller + " and security context post-mapping roles=" + currentSC.getUtil().getRoles();
/*     */
/* 355 */     if (!isAuthorized)
/* 356 */       throw new SecurityException(msg);
View Full Code Here

TOP

Related Classes of org.jboss.security.integration.ejb.EJBAuthorizationHelper

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.