public List<String> queryTokenGroups(final String ldapQuery,final StorageOSUserDAO storageOSUser){
  List<String> groups=new ArrayList<String>();
  SearchControls dnSearchControls;
  String dn=storageOSUser.getDistinguishedName();
  dnSearchControls=new SearchControls(SearchControls.OBJECT_SCOPE,1,_searchControls.getTimeLimit(),new String[]{TOKEN_GROUPS},_searchControls.getReturningObjFlag(),_searchControls.getDerefLinkFlag());
  @SuppressWarnings("unchecked") List<List<String>> tokenGroupSids=safeLdapSearch(dn,ldapQuery,dnSearchControls,new TokenGroupsMapper());
  if (null == tokenGroupSids) {
    _log.debug("No groups found for user: ",storageOSUser.getUserName());
    return groups;
  }
  List<String> unFilteredGroups=resolveGroups(tokenGroupSids.get(0));
  for (  String groupName : unFilteredGroups) {
    String groupNameWithoutDomain=groupName.substring(0,groupName.lastIndexOf("@"));
    if (isGroupOnWhiteList(groupNameWithoutDomain)) {
      groups.add(groupName);
    }
  }
  return groups;
}

public List < String > queryTokenGroups ( final String ldapQuery , final StorageOSUserDAO storageOSUser ) { List < String > groups = new ArrayList < String > ( ) ; SearchControls dnSearchControls ; String dn = storageOSUser . getDistinguishedName ( ) ; dnSearchControls = new SearchControls ( SearchControls . OBJECT_SCOPE , 1 , _searchControls . getTimeLimit ( ) , new String [ ] { TOKEN_GROUPS } , _searchControls . getReturningObjFlag ( ) , _searchControls . getDerefLinkFlag ( ) ) ; @ SuppressWarnings ( "unchecked" ) List < List < String > > tokenGroupSids = safeLdapSearch ( dn , ldapQuery , dnSearchControls , new TokenGroupsMapper ( ) ) ; if ( null == tokenGroupSids ) { _log . debug ( "No groups found for user: " , storageOSUser . getUserName ( ) ) ; return groups ; } List < String > unFilteredGroups = resolveGroups ( tokenGroupSids . get ( 0 ) ) ; for ( String groupName : unFilteredGroups ) { String groupNameWithoutDomain = groupName . substring ( 0 , groupName . lastIndexOf ( "@" ) ) ; if ( isGroupOnWhiteList ( groupNameWithoutDomain ) ) { groups . add ( groupName ) ; } } return groups ; }
get the user ' s token groups from ad . the groups returned will be on the whitelist that is configured for this authn provider . also the group name in the list will be the configured user attribute .
