Package org.apache.hadoop.gateway.security

Examples of org.apache.hadoop.gateway.security.GroupPrincipal


  private void addMappedGroupsToSubject(String mappedPrincipalName, Subject subject) {
    String[] groups = mapper.mapGroupPrincipal(mappedPrincipalName);
    if (groups != null) {
      auditor.audit( Action.IDENTITY_MAPPING, mappedPrincipalName, ResourceType.PRINCIPAL, ActionOutcome.SUCCESS, RES.groupsList( Arrays.toString( groups ) ) );
      for (int i = 0; i < groups.length; i++) {
        subject.getPrincipals().add(new GroupPrincipal(groups[i]));
      }
    }
  }
View Full Code Here


    if (groupHeaderName != null) {
      String headers = request.getHeader(groupHeaderName);
      if (headers != null) {
        String[] groups = headers.split(",");
        for (int i = 0; i < groups.length; i++) {
          principals.add(new GroupPrincipal(groups[i]));
        }
      }
    }
  }
View Full Code Here

     
      // map ldap groups saved in session to Java Subject GroupPrincipal(s)
      if (SecurityUtils.getSubject().getSession().getAttribute(SUBJECT_USER_GROUPS) != null) {
        Set<String> userRoles = (Set<String>)SecurityUtils.getSubject().getSession().getAttribute(SUBJECT_USER_GROUPS);
        for (String userRole : userRoles) {
          Principal gp = new GroupPrincipal(userRole);
          principals.add(gp);
        }
        auditor.audit( Action.AUTHENTICATION , sourceUri, ResourceType.URI, ActionOutcome.SUCCESS, "Groups: " + userRoles );
      }
     
View Full Code Here

     
      // map ldap groups saved in session to Java Subject GroupPrincipal(s)
      if (SecurityUtils.getSubject().getSession().getAttribute(SUBJECT_USER_GROUPS) != null) {
        Set<String> userRoles = (Set<String>)SecurityUtils.getSubject().getSession().getAttribute(SUBJECT_USER_GROUPS);
        for (String userRole : userRoles) {
          Principal gp = new GroupPrincipal(userRole);
          principals.add(gp);
        }
        auditor.audit( Action.AUTHENTICATION , sourceUri, ResourceType.URI, ActionOutcome.SUCCESS, "Groups: " + userRoles );
      }
     
View Full Code Here

  private void addMappedGroupsToSubject(String mappedPrincipalName, Subject subject) {
    String[] groups = mapper.mapGroupPrincipal(mappedPrincipalName);
    if (groups != null) {
      for (int i = 0; i < groups.length; i++) {
        subject.getPrincipals().add(new GroupPrincipal(groups[i]));
      }
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.gateway.security.GroupPrincipal

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.