Package org.jboss.security.identitytrust

Examples of org.jboss.security.identitytrust.IdentityTrustManager


   public void testPermit_Sufficient__Deny_Optional() throws Exception
   {
      JBossSecurityContext sc = new JBossSecurityContext("Permit_Sufficient-Deny_Optional");
      sc.setIncomingRunAs(new RunAsIdentity("theduke", "jduke"));
      assertNotNull("SecurityContext is not null", sc);
      IdentityTrustManager itm = sc.getIdentityTrustManager();
      assertNotNull("IdentityTrustManager is not null", itm);
      assertEquals("Is Trusted", TrustDecision.Permit, itm.isTrusted(sc));
   }
View Full Code Here


   public void testJavaEERunAsIdentity() throws Exception
   {
      JBossSecurityContext sc = new JBossSecurityContext("conf-javaee");
      sc.setIncomingRunAs(new RunAsIdentity("theduke", "jduke"));
      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";
         }

         public <T> T getProof()
         {
            return (T) "BAD";
         }

         public String getName()
         {
            return "BAD";
         }
      });

      assertEquals("Is Trusted is false", TrustDecision.NotApplicable, itm.isTrusted(sc));
   }
View Full Code Here

        return am;
    }

    /** {@inheritDoc} */
    public IdentityTrustManager getIdentityTrustManager(String securityDomain) {
        IdentityTrustManager itm = null;
        try {
            itm = idmMgrMap.get(securityDomain);
            if (itm == null) {
                itm = (IdentityTrustManager) lookUpJNDI(securityDomain + "/identityTrustMgr");
                idmMgrMap.put(securityDomain, itm);
View Full Code Here

/* 153 */     return am;
/*     */   }
/*     */
/*     */   public IdentityTrustManager getIdentityTrustManager(String securityDomain)
/*     */   {
/* 158 */     IdentityTrustManager am = null;
/*     */     try
/*     */     {
/* 161 */       if (this.enableIdentity)
/*     */       {
/* 163 */         am = (IdentityTrustManager)this.idmMgrMap.get(securityDomain);
View Full Code Here

/*     */   }
/*     */
/*     */   public boolean isTrusted() throws IdentityTrustException
/*     */   {
/*  52 */     IdentityTrustManager.TrustDecision td = IdentityTrustManager.TrustDecision.NotApplicable;
/*  53 */     IdentityTrustManager itm = this.securityContext.getIdentityTrustManager();
/*  54 */     if (itm != null)
/*     */     {
/*  56 */       td = itm.isTrusted(this.securityContext);
/*  57 */       if (td == IdentityTrustManager.TrustDecision.Deny)
/*  58 */         throw new IdentityTrustException("Caller denied by identity trust framework");
/*     */     }
/*  60 */     return td == IdentityTrustManager.TrustDecision.Permit;
/*     */   }
View Full Code Here

/* 201 */     String lookupURL = null;
/* 202 */     if (securityDomain.startsWith(baseContext))
/* 203 */       lookupURL = securityDomain + identityTrustMgrURL;
/*     */     else
/* 205 */       lookupURL = baseContext + "/" + securityDomain + identityTrustMgrURL;
/* 206 */     IdentityTrustManager am = null;
/*     */     try
/*     */     {
/* 209 */       InitialContext ic = new InitialContext();
/* 210 */       am = (IdentityTrustManager)ic.lookup(lookupURL);
/*     */     }
View Full Code Here

    * @throws IdentityTrustException
    */
   public boolean isTrusted() throws IdentityTrustException
   {
      TrustDecision td = TrustDecision.NotApplicable;
      IdentityTrustManager itm = securityContext.getIdentityTrustManager();
      if(itm != null)
      {
         td = itm.isTrusted(securityContext);
         if(td == TrustDecision.Deny)
            throw new IdentityTrustException("Caller denied by identity trust framework");
      }
      return td == TrustDecision.Permit;
   }  
View Full Code Here

      assertNotNull("AuthenticationManager is not null", authManager);
      AuthorizationManager authorizationMgr = sc.getAuthorizationManager();
      assertNotNull("AuthorizationManager is not null", authorizationMgr);
      AuditManager auditManager = sc.getAuditManager();
      assertNotNull("AuditManager is not null", auditManager);
      IdentityTrustManager itm = sc.getIdentityTrustManager();
      assertNotNull("IdentityTrustManager is not null", itm);
   }
View Full Code Here

        return am;
    }

    /** {@inheritDoc} */
    public IdentityTrustManager getIdentityTrustManager(String securityDomain) {
        IdentityTrustManager itm = null;
        try {
            itm = idmMgrMap.get(securityDomain);
            if (itm == null) {
                itm = (IdentityTrustManager) lookUpJNDI(securityDomain + "/identityTrustMgr");
                idmMgrMap.put(securityDomain, itm);
View Full Code Here

TOP

Related Classes of org.jboss.security.identitytrust.IdentityTrustManager

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.