Package org.jboss.security.integration.ejb

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


         sc = SecurityActions.getSecurityContext();
         //TODO: Need to get the SecurityManagement instance
         sc.setSecurityManagement(new JNDIBasedSecurityManagement());
          
         //Check if there is a RunAs configured and can be trusted
         EJBAuthenticationHelper helper = new EJBAuthenticationHelper(sc);
         boolean trustedCaller = helper.isTrusted();
         if(!trustedCaller)
         {
            Subject subject = new Subject();
            //Authenticate the caller now
            if(!helper.isValid(subject, method.getName()))
               throw new EJBAccessException("Invalid User");
            helper.pushSubjectContext(subject);
         }
         else
        
            //Trusted caller. No need for authentication. Straight to authorization
         }
View Full Code Here


/*     */     {
/* 288 */       throw new SecurityException("Role mapping manager has not been set");
/*     */     }
/*     */
/* 291 */     SecurityContext sc = SecurityActions.getSecurityContext();
/* 292 */     EJBAuthenticationHelper helper = new EJBAuthenticationHelper(sc);
/* 293 */     boolean isTrusted = helper.isTrusted();
/*     */
/* 295 */     if (!isTrusted)
/*     */     {
/* 298 */       Subject subject = new Subject();
/* 299 */       if (!helper.isValid(subject, m.getName()))
/*     */       {
/* 302 */         if (this.authenticationObserver != null) {
/* 303 */           this.authenticationObserver.authenticationFailed();
/*     */         }
/* 305 */         String msg = "Authentication exception, principal=" + principal;
View Full Code Here

/*     */
/* 130 */       sc = SecurityActions.getSecurityContext();
/*     */
/* 132 */       sc.setSecurityManagement(new JNDIBasedSecurityManagement());
/*     */
/* 135 */       EJBAuthenticationHelper helper = new EJBAuthenticationHelper(sc);
/* 136 */       boolean trustedCaller = helper.isTrusted();
/* 137 */       if (!trustedCaller)
/*     */       {
/* 139 */         Subject subject = new Subject();
/*     */
/* 141 */         if (!helper.isValid(subject, method.getName()))
/* 142 */           throw new EJBAccessException("Invalid User");
/* 143 */         helper.pushSubjectContext(subject);
/*     */       }
/*     */
/*     */     }
/* 157 */     else if (invSC != null)
/*     */     {
View Full Code Here

TOP

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

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.