Class SpnegoAuthenticator


  • public final class SpnegoAuthenticator
    extends Object
    Handles SPNEGO or Basic authentication.

    Be cautious about who you give a reference to.

    Basic Authentication must be enabled through the filter configuration. See an example web.xml configuration in the installing on tomcat documentation or the SpnegoHttpFilter javadoc.

    Localhost is supported but must be enabled through the filter configuration. Allowing requests to come from the DNS http://localhost will obviate the requirement that a service must have an SPN. Note that Kerberos authentication (if localhost) does not occur but instead simply returns the System.getProperty("user.name") or the Server's pre-authentication username.

    NTLM tokens are NOT supported. However it is still possible to avoid an error being returned by downgrading the authentication from Negotiate NTLM to Basic Auth.

    See the reference docs on how to configure the web.xml to prompt when if a request is being made using NTLM.

    Finally, to see a working example and instructions on how to use a keytab, take a look at the creating a server keytab example.

    Author:
    Darwin V. Felix