Package org.jboss.security

Examples of org.jboss.security.SubjectInfo


/*     */
/*     */   public Principal getUserPrincipal()
/*     */   {
/*  76 */     validateSecurityContext();
/*  77 */     Principal p = null;
/*  78 */     SubjectInfo subjectInfo = this.securityContext.getSubjectInfo();
/*  79 */     if (subjectInfo != null)
/*     */     {
/*  81 */       p = subjectInfo.getAuthenticationPrincipal();
/*     */     }
/*  83 */     return p;
/*     */   }
View Full Code Here


/*     */
/*     */   public Object getCredential()
/*     */   {
/*  88 */     validateSecurityContext();
/*  89 */     Object cred = null;
/*  90 */     SubjectInfo subjectInfo = this.securityContext.getSubjectInfo();
/*  91 */     if (subjectInfo != null)
/*     */     {
/*  93 */       cred = subjectInfo.getAuthenticationCredential();
/*     */     }
/*  95 */     return cred;
/*     */   }
View Full Code Here

/*     */
/*     */   public Subject getSubject()
/*     */   {
/* 100 */     validateSecurityContext();
/* 101 */     Subject s = null;
/* 102 */     SubjectInfo subjectInfo = this.securityContext.getSubjectInfo();
/* 103 */     if (subjectInfo != null)
/*     */     {
/* 105 */       s = subjectInfo.getAuthenticatedSubject();
/*     */     }
/* 107 */     return s;
/*     */   }
View Full Code Here

        }
    }

    private boolean authenticate(SecurityContext context) {
        SecurityContextUtil util = context.getUtil();
        SubjectInfo subjectInfo = context.getSubjectInfo();
        Subject subject = new Subject();
        Principal principal = util.getUserPrincipal();
        Object credential = util.getCredential();

        boolean authenticated = false;
        if (principal == null) {
            Identity unauthenticatedIdentity = getUnauthenticatedIdentity();
            subjectInfo.addIdentity(unauthenticatedIdentity);
            subject.getPrincipals().add(unauthenticatedIdentity.asPrincipal());
            authenticated = true;
        }

        if (authenticated == false) {
            AuthenticationManager authenticationManager = context.getAuthenticationManager();
            authenticated = authenticationManager.isValid(principal, credential, subject);
        }
        if (authenticated == true) {
            subjectInfo.setAuthenticatedSubject(subject);
        }

        return authenticated;
    }
View Full Code Here

        }
    }

    private boolean authenticate(SecurityContext context) {
        SecurityContextUtil util = context.getUtil();
        SubjectInfo subjectInfo = context.getSubjectInfo();
        Subject subject = new Subject();
        Principal principal = util.getUserPrincipal();
        Object credential = util.getCredential();

        boolean authenticated = false;
        if (principal == null) {
            Identity unauthenticatedIdentity = getUnauthenticatedIdentity();
            subjectInfo.addIdentity(unauthenticatedIdentity);
            subject.getPrincipals().add(unauthenticatedIdentity.asPrincipal());
            authenticated = true;
        }

        if (authenticated == false) {
            AuthenticationManager authenticationManager = context.getAuthenticationManager();
            authenticated = authenticationManager.isValid(principal, credential, subject);
        }
        if (authenticated == true) {
            subjectInfo.setAuthenticatedSubject(subject);
        }

        return authenticated;
    }
View Full Code Here

   @Override
   public Principal getUserPrincipal()
   { 
      validateSecurityContext();
      Principal p = null;
      SubjectInfo subjectInfo = this.securityContext.getSubjectInfo();
      if(subjectInfo != null)
      {
         p = subjectInfo.getAuthenticationPrincipal();
      }
      return p;
   }
View Full Code Here

  
   public Object getCredential()
   {
      validateSecurityContext();
      Object cred = null;
      SubjectInfo subjectInfo = this.securityContext.getSubjectInfo();
      if(subjectInfo != null)
      {
         cred = subjectInfo.getAuthenticationCredential();
      }
      return cred;
   }
View Full Code Here

  
   public Subject getSubject()
   {
      validateSecurityContext();
      Subject s = null;
      SubjectInfo subjectInfo = this.securityContext.getSubjectInfo();
      if(subjectInfo != null)
      {
         s = subjectInfo.getAuthenticatedSubject();
      }
      return s;
   }
View Full Code Here

      {
         Subject theSubject = null;
         SecurityContext sc = SecurityContextAssociation.getSecurityContext();
         if(sc != null)
         {
            SubjectInfo si = sc.getSubjectInfo();
           
            if(si != null)
            {
               Subject activeSubject = si.getAuthenticatedSubject();
               RunAsIdentity callerRunAsIdentity = (RunAsIdentity)sc.getUtil().get(CALLER_RAI_IDENTIFIER);
              
               if( activeSubject != null )
               {
                  Set principalsSet = null;
View Full Code Here

TOP

Related Classes of org.jboss.security.SubjectInfo

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.