Package org.jboss.security

Examples of org.jboss.security.RunAs


            InvokerLocator locator = (InvokerLocator) invocation.getMetaData(InvokeRemoteInterceptor.REMOTING,
                  InvokeRemoteInterceptor.INVOKER_LOCATOR);

            String iface = (locator != null) ? "Remote" : "Local";
           
            RunAs callerRunAs = SecurityActions.peekRunAs();
           
            AbstractEJBAuthorizationHelper helper = null;
            try
            {
               helper = SecurityHelperFactory.getEJBAuthorizationHelper(sc);
View Full Code Here


      return (ISecurityManagement) clazz.newInstance();   
   }
  
   private boolean hasIncomingRunAsIdentity(SecurityContext sc)
   {
      RunAs incomingRunAs = sc.getIncomingRunAs();
      return incomingRunAs != null && incomingRunAs instanceof RunAsIdentity;
   }
View Full Code Here

      }
      SecurityContext sc = scb.getSecurityContext();
     
      //Handle the case of Incoming RunAs
      Principal callerPrincipal = null;
      RunAs callerRunAs = sc.getIncomingRunAs();
      if(callerRunAs != null)
      {
         callerPrincipal = new SimplePrincipal(callerRunAs.getName());
      }
     
      RoleGroup roles = this.getCurrentRoles(callerPrincipal, authenticatedSubject, sc);
      if(roles == null)
         roles = new SimpleRoleGroup(SecurityConstants.ROLES_IDENTIFIER);
View Full Code Here

      assertNull("Caller Principal is null", SecurityAssociation.getCallerPrincipal());
     
      //Create a security context with runas
      sc =  new JBossSecurityContext("TEST");
     
      @SuppressWarnings("unchecked")
      RunAs ras = new RunAs()
      {
         public <T> T getIdentity()
         {
            return (T) getName();
         }
View Full Code Here

      assertNotNull("SecurityContext is not null", sc);
      IdentityTrustManager itm = sc.getIdentityTrustManager();
      assertNotNull("IdentityTrustManager is not null", itm);
      assertEquals("Is Trusted", TrustDecision.Permit, itm.isTrusted(sc));

      sc.setIncomingRunAs(new RunAs()
      {
         public <T> T getIdentity()
         {
            return (T) "BAD";
         }
View Full Code Here

            AssemblyDescriptorMetaData assemblyDescriptor = applicationMetaData.getAssemblyDescriptor();
            String roleName = ejbTimeoutIdentity.getRunAsRoleName();
            String principalName = ejbTimeoutIdentity.getRunAsPrincipalName();
            // the run-as principal might have extra roles mapped in the assembly-descriptor
            Set extraRoleNames = assemblyDescriptor.getSecurityRoleNamesByPrincipal(principalName);
            RunAs runAsIdentity = new RunAsIdentity(roleName, principalName, extraRoleNames);
            SecurityActions.pushRunAsIdentity(runAsIdentity);
            pushedRunAs = true;
         }
         container.invoke(inv);
      }
View Full Code Here

      }
      SecurityContext sc = scb.getSecurityContext();
     
      //Handle the case of Incoming RunAs
      Principal callerPrincipal = null;
      RunAs callerRunAs = sc.getIncomingRunAs();
      if(callerRunAs != null)
      {
         callerPrincipal = new SimplePrincipal(callerRunAs.getName());
      }
     
      RoleGroup roles = this.getCurrentRoles(callerPrincipal, authenticatedSubject, sc);
      if(roles == null)
         roles = new SimpleRoleGroup(SecurityConstants.ROLES_IDENTIFIER);
View Full Code Here

/* 132 */     if (key == null)
/* 133 */       throw new IllegalArgumentException("Key is null");
/* 134 */     Map contextMap = this.securityContext.getData();
/* 135 */     if ("RunAsIdentity".equals(key))
/*     */     {
/* 137 */       RunAs runAs = this.securityContext.getOutgoingRunAs();
/*     */
/* 139 */       this.securityContext.setOutgoingRunAs((RunAs)contextMap.get("CallerRunAsIdentity"));
/*     */
/* 142 */       contextMap.remove("CallerRunAsIdentity");
/* 143 */       return runAs;
View Full Code Here

/*     */
/*     */   private void setRunAsIdentity(RunAsIdentity rai)
/*     */   {
/* 176 */     Map contextMap = this.securityContext.getData();
/*     */
/* 179 */     RunAs currentRA = this.securityContext.getOutgoingRunAs();
/* 180 */     contextMap.put("CallerRunAsIdentity", currentRA);
/*     */
/* 182 */     this.securityContext.setOutgoingRunAs(rai);
/*     */   }
View Full Code Here

/*     */     {
/*  67 */       invocation.setCredential(credential);
/*     */     }
/*     */
/*  70 */     SecurityContext sc = sa.getSecurityContext();
/*  71 */     RunAs callerRAI = sa.getCallerRunAsIdentity();
/*  72 */     SecurityContext newSc = createSecurityContext(invocation);
/*     */
/*  74 */     if (callerRAI != null)
/*     */     {
/*  76 */       newSc.setOutgoingRunAs(callerRAI);
View Full Code Here

TOP

Related Classes of org.jboss.security.RunAs

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.