Just finished figuring this out. Don't know if it's the best solution. Looked like there were other options.
In my case the first thread group was reading a list of users and passwords from a csv file.
I did it by writing a csv file in the first thread using "JSR223 PostProcessor" after each authentication API call.
Then I read the newly created csv using the "CSV Data Set Config" in the second thread.
Groovy script follows:
import org.apache.jmeter.services.FileServer
log.info("*************************************")
def userId = vars.get("user_id") //JMeter var from parsing auth request
def authToken= vars.get("auth_token")
def configDir = vars.get("config_dir")
log.info("userId:" + userId)
log.info("authToken:" + authToken)
def outputFilePath = configDir + "/userToken.csv"
File outputFile = new File(outputFilePath)
//check if the file exists
if (!outputFile.exists()) {
log.info("File " + outputFilePath + "does not exist")
log.info("Creating a new file")
outputFile << "userId,authToken\n"
}
outputFile << userId + "," + authToken + "\n"
Test Plan on JMeter