Examples of SecurityContext


Examples of org.jboss.security.SecurityContext

      }
   }
  
   private SecurityContext createSecurityContext()
   {
      SecurityContext securityContext = null;
      try
      {
         securityContext =
            SecurityAssociationActions.createSecurityContext(this.configuredSecurityDomainName,
               this.securityContextClass);
      }
      catch (PrivilegedActionException e)
      {
         throw new RuntimeException(e);
      }
     
      securityContext.setSecurityManagement(securityManagement);
      return securityContext;
   }
View Full Code Here

Examples of org.jboss.security.SecurityContext

   @Override
   public void event(Request request, Response response, HttpEvent event)
      throws IOException, ServletException
   {
      SecurityContext cachedContext = null;
     
      boolean createdSecurityContext = false;
      //Set the security context if one is unavailable
      SecurityContext sc = SecurityAssociationActions.getSecurityContext();
      if(sc != null &&
            sc.getSecurityDomain().equals(configuredSecurityDomainName) == false)
      {
         cachedContext = sc;
         SecurityContext newSC = createSecurityContext();
         SecurityAssociationActions.setSecurityContext(newSC);
         createdSecurityContext = true;
      }
     
      if(sc == null)
View Full Code Here

Examples of org.jboss.security.SecurityContext

      Principal getCallerPrincipalInternal()
      {
         if( beanPrincipal == null )
         {   
            RealmMapping rm = con.getRealmMapping();
            SecurityContext sc = SecurityActions.getSecurityContext();
            Principal caller = null;
            try
            {
               caller = SecurityHelperFactory.getEJBAuthorizationHelper(sc).getCallerPrincipal();
            }
View Full Code Here

Examples of org.jboss.security.SecurityContext

         {
           if(log.isTraceEnabled())
              log.trace("PolicyContextException in getting caller subject:",pe);
         }
 
         SecurityContext sc = SecurityActions.getSecurityContext();
         String ejbName = container.getBeanMetaData().getEjbName();
        
         try
         {
            return SecurityActions.isCallerInRole(sc, roleName,
View Full Code Here

Examples of org.jboss.security.SecurityContext

      AccessController.doPrivileged(new PrivilegedAction<Void>()
      {

         public Void run()
         {
            final SecurityContext securityContext = SecurityContextAssociation.getSecurityContext();
            if (securityContext == null)
            {
               throw new IllegalStateException("Security Context is null");
            }

            securityContext.getUtil().createSubjectInfo(principal, credential, subject);

            return null;
         }
      });
   }
View Full Code Here

Examples of org.jboss.security.SecurityContext

      {
         Subject caller = this.establishSubjectContext(request.getPrincipal());

         PolicyRegistration policyRegistration = getPolicyRegistration();

         SecurityContext sc = SecurityAssociationActions.getSecurityContext();
         Map<String, Object> contextMap = new HashMap<String, Object>();
         contextMap.put(ResourceKeys.RESOURCE_PERM_CHECK, Boolean.TRUE);
         contextMap.put(ResourceKeys.POLICY_REGISTRATION, policyRegistration);
         contextMap.put("securityConstraints", securityConstraints);
View Full Code Here

Examples of org.jboss.security.SecurityContext

      boolean authzDecision = ignoreJBossAuthorization ? true : false;
      boolean baseDecision = ignoreBaseDecision ? true : super.hasRole(principal, role);

      if (baseDecision && !ignoreJBossAuthorization)
      {
         SecurityContext sc = SecurityAssociationActions.getSecurityContext();

         AbstractWebAuthorizationHelper helper = null;
         try
         {
            helper = SecurityHelperFactory.getWebAuthorizationHelper(sc);
View Full Code Here

Examples of org.jboss.security.SecurityContext

         establishSubjectContext(requestPrincipal);
         Map<String, Object> map = new HashMap<String, Object>();
         map.put("securityConstraints", constraints);
         map.put(ResourceKeys.USERDATA_PERM_CHECK, Boolean.TRUE);

         SecurityContext sc = SecurityAssociationActions.getSecurityContext();
         AbstractWebAuthorizationHelper helper = null;
         try
         {
            helper = SecurityHelperFactory.getWebAuthorizationHelper(sc);
         }
View Full Code Here

Examples of org.jboss.security.SecurityContext

      contextMap.put("Source", getClass().getName());
      AuditEvent ae = new AuditEvent(level);
      ae.setContextMap(contextMap);
      ae.setUnderlyingException(e);

      SecurityContext sc = SecurityAssociationActions.getSecurityContext();
      if (sc != null)
      {
         AuditManager auditManager = sc.getAuditManager();
         if (auditManager != null)
            auditManager.audit(ae);
         else
            log.trace("Audit Manager obtained from Security Context is null");
      }
View Full Code Here

Examples of org.jboss.soa.esb.services.security.SecurityContext

    TestPrincipal principal = new TestPrincipal(userName);
    Set<Object> credentials = new HashSet<Object>();
    credentials.add(password);

    AuthenticationRequest authRequest = new AuthenticationRequestImpl.Builder(principal, credentials).build();
    SecurityContext context = new SecurityContext(subject, SecurityContext.getConfigurationTimeout());
    service.configure();
    service.authenticate(configInfo, context, authRequest);

    Set<TestPrincipal> principals = subject.getPrincipals( TestPrincipal.class );
    assertEquals( 1, principals.size() );
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.