Class KerberosCredentialValidator

    • Field Detail

      • log

        @Nonnull
        private final org.slf4j.Logger log
        Class logger.
      • refreshKrb5Config

        private boolean refreshKrb5Config
        Refresh the Kerberos config before running?
      • preserveTicket

        private boolean preserveTicket
        Save the TGT in the resulting Subject?
      • servicePrincipal

        private String servicePrincipal
        Service principal to acquire a ticket for to verify KDC.
      • keytabPath

        private String keytabPath
        Path to keytab for service principal.
    • Constructor Detail

      • KerberosCredentialValidator

        public KerberosCredentialValidator()
        Constructor.
    • Method Detail

      • setLoginModuleClassName

        public void setLoginModuleClassName​(@Nonnull
                                            String name)
        Set the name of the JAAS LoginModule to use to acquire Kerberos credentials.
        Parameters:
        name - name of login module class
      • setRefreshKrb5Config

        public void setRefreshKrb5Config​(boolean flag)
        Set whether to refresh the Kerberos configuration before running.
        Parameters:
        flag - flag to set
      • setPreserveTicket

        public void setPreserveTicket​(boolean flag)
        Set whether to save the TGT in the Subject.
        Parameters:
        flag - flag to set
      • setServicePrincipal

        public void setServicePrincipal​(@Nullable
                                        String name)
        Set the name of a service principal to use to verify the KDC.

        If non-null, a keytab resource must also be set.

        Parameters:
        name - name of service principal
      • setKeytabPath

        public void setKeytabPath​(@Nullable
                                  String path)
        Provides a keytab for the service principal to use to verify the KDC.
        Parameters:
        path - path to file containing a keytab
      • verifyKDC

        private void verifyKDC​(@Nonnull
                               Subject subject)
                        throws Exception
        Use credentials to acquire and verify a service ticket.
        Parameters:
        subject - client identity
        Throws:
        Exception - if an error occurs