Package org.glassfish.security.common

Examples of org.glassfish.security.common.PrincipalImpl


     * @param The Credentials of the user.
     */
    public ClientSecurityContext(String userName,
         Subject s) {

  this.initiator = new PrincipalImpl(userName);
  this.subject = s ;
    }
View Full Code Here


        if (principal == null) {
            if (cpCallback.getName() != null) {
                if (isCertRealm) {
                    principal = new X500Principal(cpCallback.getName());
                } else {
                    principal = new PrincipalImpl(cpCallback.getName());
                }
            } else {
                // 196 unauthenticated caller principal
                principal = SecurityContext.getDefaultCallerPrincipal();
            }
View Full Code Here

      s = new Subject();
            if (_logger.isLoggable(Level.WARNING)) {
          _logger.warning("java_security.null_subject");
            }
  }
  this.initiator = new PrincipalImpl(userName);
        final Subject sub = s;
        this.subject = (Subject)
            AppservAccessController.doPrivileged(new PrivilegedAction(){
                public java.lang.Object run() {
                    sub.getPrincipals().add(initiator);
View Full Code Here

  } else {
      // add a Principal (authenticated identity)
      // to the Subject

      // assume the user we authenticated is the PrincipalImpl
      userPrincipal = new PrincipalImpl(username);
      if (!subject.getPrincipals().contains(userPrincipal)){
    subject.getPrincipals().add(userPrincipal);
            }
            _logger.log(Level.FINE,"\t\t[ClientPasswordLoginModule] " +
                        "added PrincipalImpl to Subject");
View Full Code Here

    } finally {
        if (guestUser == null) {
      guestUser = "ANONYMOUS";
        }
    }
    defaultSecurityContext.initiator = new PrincipalImpl(guestUser);
      }
  }
  return defaultSecurityContext.initiator;
    }
View Full Code Here

  } else {
      // add a Principal (authenticated identity)
      // to the Subject

      // assume the user we authenticated is the PrincipalImpl
      userPrincipal = new PrincipalImpl(alias);
      if (!subject.getPrincipals().contains(userPrincipal)){
    subject.getPrincipals().add(userPrincipal);
            }

      if (debug) {
View Full Code Here

        }
        return _getWebSecurityManagerFactory();
    }
    public static PrincipalImpl getPrincipalInstance(String name, String realm){
        WebSecurityManagerFactory fact = getWebSecurityManagerFactory();
        PrincipalImpl p = (PrincipalImpl)fact.getAdminPrincipal(name, realm) ;
        if(p == null){
            p = new PrincipalImpl(name);
        }
        return p;
    }
View Full Code Here

                    if(srms != null){
                        for (SecurityRoleMapping srm : srms) {
                            String[] principals = srm.getPrincipalName();
                            if (principals != null) {
                                for (String principal : principals) {
                                    wsmf.ADMIN_PRINCIPAL.put(realmName + principal, new PrincipalImpl(principal));
                                }
                            }
                            for (String group : srm.getGroupNames()) {
                                wsmf.ADMIN_GROUP.put(realmName + group, new Group(group));
                            }
                        }
                    }
                    WLSecurityRoleAssignment[] sras = sunDes.getWLSecurityRoleAssignment();
                    if(sras != null){
                        for (WLSecurityRoleAssignment sra : sras) {
                            List<String> principals = sra.getPrincipalNames();
                            if (sra.isExternallyDefined()) {
                                wsmf.ADMIN_GROUP.put(realmName + sra.getRoleName(), new Group(sra.getRoleName()));
                                continue;
                            }
                            for (String principal : principals) {
                                    wsmf.ADMIN_PRINCIPAL.put(realmName + principal, new PrincipalImpl(principal));
                            }
                           
                        }
                    }
                }
View Full Code Here

            asPrincipal = (PrincipalImpl) securityMap.get(eisPrincipal);
            if(logger.isLoggable(Level.FINEST)){
                logger.finest("got mapped principal as [" + asPrincipal + "] for eis-group [" + eisPrincipal.getName() + "]");
            }
        } else if (eisName != null) {
            asPrincipal = ((PrincipalImpl) securityMap.get(new PrincipalImpl(eisName)));
            if(logger.isLoggable(Level.FINEST)){
                logger.finest("got mapped principal as [" + asPrincipal + "] for eis-group [" + eisName + "]");
            }
        }
        return asPrincipal;
View Full Code Here

        List<GroupMap> groupsMap = getGroupsMap(maps);

        HashMap eisASMap = new HashMap();

        for(PrincipalMap map : principalsMap){
            eisASMap.put(new PrincipalImpl(map.getEisPrincipal()), new PrincipalImpl(map.getMappedPrincipal()));
        }

        for(GroupMap map : groupsMap){
            eisASMap.put(new Group(map.getEisGroup()), new Group(map.getMappedGroup()));
        }
View Full Code Here

TOP

Related Classes of org.glassfish.security.common.PrincipalImpl

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.