Package com.mongodb

Class KerberosSubjectProvider

All Implemented Interfaces:

@ThreadSafe public class KerberosSubjectProvider extends Object implements SubjectProvider
An implementation of SubjectProvider suitable for use as the value of the MongoCredential.JAVA_SUBJECT_PROVIDER_KEY mechanism property for Kerberos credentials, created via MongoCredential.createGSSAPICredential(String).

An instance of this class will cache a Kerberos Subject until its TGT is close to expiration, at which point it will replace the Subject with a new one.

Subject instances are created by first constructing a LoginContext with the specified name, then calling its LoginContext.login() method, and finally acquiring the Subject via a call to LoginContext.getSubject().

See Also:
  • Constructor Details

    • KerberosSubjectProvider

      public KerberosSubjectProvider()
      Construct an instance with the default login context name "".

      For compatibility, falls back to ""

    • KerberosSubjectProvider

      public KerberosSubjectProvider(String loginContextName)
      Construct an instance with the specified login context name
      loginContextName - the login context name
  • Method Details