com.mongodb.DB.authenticate(username, password) fails often when invoked from multiple threads. Mongod console logs "auth: bad nonce received or getnonce not called. could be a driver bug or a security attack" whenever authentication fails.
authenticate method should return consistent results.
Steps to reproduce:
import https://gist.github.com/2882362 to your workspace and run or download the attached sample project, import it to your favourite IDE and run.