public static Properties getCredentials(Properties securityProps) {
    Properties credentials = null;
    if (securityProps.containsKey(USER_NAME) && securityProps.containsKey(PASSWORD)) {
      credentials = new Properties();
      credentials.setProperty(USER_NAME, securityProps.getProperty(USER_NAME));
      credentials.setProperty(PASSWORD, securityProps.getProperty(PASSWORD));
    }
    return credentials;
  }
Utility for gathering security credentials from securityProperties.
geode-core/src/main/java/org/apache/geode/internal/security/Credentials.java