My mongodb is set up to use Kerberos and everything is working fine when I access the database from the shell.
Now I need my Java applications to also connect to the databases, authenticating using Kerberos. Apart of the few lines in http://docs.mongodb.org/ecosystem/tutorial/authenticate-with-java-driver/ I have not found how to make this work.
My main use case is harder than described on that page. I have a tomcat server that serves multiple users - so I need the user to log into the application and supply their principal name and password and I want the Java server to authenticate to the KDC and then use the provided ticket to mongodb -- I can't find a way to do this.
If this is not possible and I have to use a separate tomcat server per user, I assume I can do a kinit and then start tomcat? That would mean that each user would have to run their own server. Not that great - but even here - what do I need to do so that the Java process uses whatever kinit puts in the session.
Any other suggestion on how to do this is also greatly appreciated (E.g. can my servlet running in tomcat get something from the user's browser that is a Kerberos ticket? Without rocket science and expensive licenses..). All I want to do is allow people to login to mongodb using Kerberos credentials -- but through a Java app.