dbeaver: Kerberos-auth PostgreSQL connection fails with "No LoginModules configured"

Solution 1:

tl;dr: possibly set Connection settings / jaasApplicationName to "Krb5ConnectorContext". Or... see later.

As far as I've seen (... using strace on dbeaver and looking for attempts to read the jaas.conf file), dbeaver itself creates it in /tmp, then (presumably) reads it back later. As it turns out, the temp file (which can be observed while the app is running) already looks fairly reasonable and in line with random internet recommendations:

Krb5ConnectorContext {
com.sun.security.auth.module.Krb5LoginModule required 
     useTicketCache=true 
     debug=true 
     renewTGT=true 
     doNotPrompt=true; 
};

(line breaks inserted for readability.)

As it turns out, however, this config is for particular app names, in our case, "Krb5ConnectorContext". As per this email, you can configure what app name dbeaver uses by changing the "jaasApplicationName" property in "Connection Settings / Driver Properties".

It looks like dbeaver is not actually using the same default at both places: while it's "Krb5ConnectorContext" that gets put in the config file for itself, the default "jaasApplicationName" seems to be "pgjdbc" instead (... based on the error message). Setting it to "Krb5ConnectorContext" solved the problem for me.

UPDATE: after a restart, it looks like it isn't creating the file anymore... if all else fails, you can force it by adding a line

-Djava.security.auth.login.config=/etc/jaas.conf

to /usr/share/dbeaver/dbeaver.ini, and then actually create /etc/jaas.conf with the above contents.