Package waffle.apache
Class NegotiateAuthenticator
java.lang.Object
org.apache.catalina.util.LifecycleBase
org.apache.catalina.util.LifecycleMBeanBase
org.apache.catalina.valves.ValveBase
org.apache.catalina.authenticator.AuthenticatorBase
waffle.apache.NegotiateAuthenticator
- All Implemented Interfaces:
jakarta.security.auth.message.config.RegistrationListener
,MBeanRegistration
,org.apache.catalina.Authenticator
,org.apache.catalina.Contained
,org.apache.catalina.JmxEnabled
,org.apache.catalina.Lifecycle
,org.apache.catalina.Valve
public class NegotiateAuthenticator
extends org.apache.catalina.authenticator.AuthenticatorBase
An Apache Negotiate (NTLM, Kerberos) Authenticator.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.catalina.authenticator.AuthenticatorBase
org.apache.catalina.authenticator.AuthenticatorBase.AllowCorsPreflight
Nested classes/interfaces inherited from interface org.apache.catalina.Lifecycle
org.apache.catalina.Lifecycle.SingleUse
-
Field Summary
Modifier and TypeFieldDescriptionprotected boolean
The allow guest login.protected IWindowsAuthProvider
The auth.protected int
The auth continueContextsTimeout configuration.protected String
The info.protected org.slf4j.Logger
The log.protected PrincipalFormat
The principal format.The protocols.protected PrincipalFormat
The role format.Fields inherited from class org.apache.catalina.authenticator.AuthenticatorBase
alwaysUseSession, AUTH_HEADER_NAME, cache, changeSessionIdOnAuthentication, context, disableProxyCaching, jaspicCallbackHandlerClass, REALM_NAME, securePagesWithPragma, secureRandomAlgorithm, secureRandomClass, secureRandomProvider, sendAuthInfoResponseHeaders, sessionIdGenerator, sm, sso
Fields inherited from class org.apache.catalina.valves.ValveBase
asyncSupported, container, containerLog, next
Fields inherited from interface org.apache.catalina.Lifecycle
AFTER_DESTROY_EVENT, AFTER_INIT_EVENT, AFTER_START_EVENT, AFTER_STOP_EVENT, BEFORE_DESTROY_EVENT, BEFORE_INIT_EVENT, BEFORE_START_EVENT, BEFORE_STOP_EVENT, CONFIGURE_START_EVENT, CONFIGURE_STOP_EVENT, PERIODIC_EVENT, START_EVENT, STOP_EVENT
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
authenticate
(org.apache.catalina.connector.Request request, javax.servlet.http.HttpServletResponse response) protected org.apache.catalina.realm.GenericPrincipal
createPrincipal
(IWindowsIdentity windowsIdentity) This method will create an instance of a IWindowsIdentity based GenericPrincipal.protected boolean
doAuthenticate
(org.apache.catalina.connector.Request request, javax.servlet.http.HttpServletResponse response) XXX The 'doAuthenticate' is intended to replace 'authenticate' for needs like ours.protected Principal
getAuth()
Windows authentication provider.protected String
int
Gets the continue context time out configuration.getInfo()
Gets the info.Principal format.Principal format.boolean
True if Guest login permitted.protected void
sendError
(javax.servlet.http.HttpServletResponse response, int code) Send an error code.protected void
sendUnauthorized
(javax.servlet.http.HttpServletResponse response) Send a 401 Unauthorized along with protocol authentication headers.void
setAllowGuestLogin
(boolean value) Set whether Guest login is permitted.void
setAuth
(IWindowsAuthProvider provider) Set Windows auth provider.void
setContinueContextsTimeout
(int continueContextsTimeout) Sets the continue context time out configuration.void
setPrincipalFormat
(String format) Set the principal format.void
setProtocols
(String value) Set the authentication protocols.void
setRoleFormat
(String format) Set the principal format.void
Hook to the start and to set up the dependencies.void
Methods inherited from class org.apache.catalina.authenticator.AuthenticatorBase
allowCorsPreflightBypass, associate, authenticate, changeSessionID, checkForCachedAuthentication, doAuthenticate, getAllowCorsPreflight, getAlwaysUseSession, getCache, getChangeSessionIdOnAuthentication, getContainer, getDisableProxyCaching, getJaspicCallbackHandlerClass, getRealmName, getSecurePagesWithPragma, getSecureRandomAlgorithm, getSecureRandomClass, getSecureRandomProvider, invoke, isContinuationRequired, isPreemptiveAuthPossible, isSendAuthInfoResponseHeaders, login, logout, notify, reauthenticateFromSSO, register, register, setAllowCorsPreflight, setAlwaysUseSession, setCache, setChangeSessionIdOnAuthentication, setContainer, setDisableProxyCaching, setJaspicCallbackHandlerClass, setSecurePagesWithPragma, setSecureRandomAlgorithm, setSecureRandomClass, setSecureRandomProvider, setSendAuthInfoResponseHeaders
Methods inherited from class org.apache.catalina.valves.ValveBase
backgroundProcess, getDomainInternal, getNext, getObjectNameKeyProperties, initInternal, isAsyncSupported, setAsyncSupported, setNext, toString
Methods inherited from class org.apache.catalina.util.LifecycleMBeanBase
destroyInternal, getDomain, getObjectName, postDeregister, postRegister, preDeregister, preRegister, register, setDomain, unregister, unregister
Methods inherited from class org.apache.catalina.util.LifecycleBase
addLifecycleListener, destroy, findLifecycleListeners, fireLifecycleEvent, getState, getStateName, getThrowOnFailure, init, removeLifecycleListener, setState, setState, setThrowOnFailure, start, stop
-
Field Details
-
info
The info. -
log
protected org.slf4j.Logger logThe log. -
principalFormat
The principal format. -
roleFormat
The role format. -
allowGuestLogin
protected boolean allowGuestLoginThe allow guest login. -
protocols
The protocols. -
continueContextsTimeout
protected int continueContextsTimeoutThe auth continueContextsTimeout configuration. -
auth
The auth.
-
-
Constructor Details
-
NegotiateAuthenticator
public NegotiateAuthenticator()Instantiates a new negotiate authenticator.
-
-
Method Details
-
startInternal
public void startInternal() throws org.apache.catalina.LifecycleExceptionHook to the start and to set up the dependencies.- Throws:
org.apache.catalina.LifecycleException
- the lifecycle exception
-
stopInternal
public void stopInternal() throws org.apache.catalina.LifecycleException- Overrides:
stopInternal
in classorg.apache.catalina.authenticator.AuthenticatorBase
- Throws:
org.apache.catalina.LifecycleException
-
authenticate
public boolean authenticate(org.apache.catalina.connector.Request request, javax.servlet.http.HttpServletResponse response) -
doAuthenticate
protected boolean doAuthenticate(org.apache.catalina.connector.Request request, javax.servlet.http.HttpServletResponse response) throws IOException XXX The 'doAuthenticate' is intended to replace 'authenticate' for needs like ours. In order to support old and new at this time, we will continue to have both for time being.- Throws:
IOException
-
getContinueContextsTimeout
public int getContinueContextsTimeout()Gets the continue context time out configuration.- Returns:
- the continue contexts timeout
-
setContinueContextsTimeout
public void setContinueContextsTimeout(int continueContextsTimeout) Sets the continue context time out configuration.- Parameters:
continueContextsTimeout
- the new continue contexts timeout
-
getAuth
Windows authentication provider.- Returns:
- IWindowsAuthProvider.
-
setAuth
Set Windows auth provider.- Parameters:
provider
- Class implements IWindowsAuthProvider.
-
getInfo
Gets the info.- Returns:
- the info
-
setPrincipalFormat
Set the principal format.- Parameters:
format
- Principal format.
-
getPrincipalFormat
Principal format.- Returns:
- Principal format.
-
setRoleFormat
Set the principal format.- Parameters:
format
- Role format.
-
getRoleFormat
Principal format.- Returns:
- Role format.
-
isAllowGuestLogin
public boolean isAllowGuestLogin()True if Guest login permitted.- Returns:
- True if Guest login permitted, false otherwise.
-
setAllowGuestLogin
public void setAllowGuestLogin(boolean value) Set whether Guest login is permitted. Default is true, if the Guest account is enabled, an invalid username/password results in a Guest login.- Parameters:
value
- True or false.
-
setProtocols
Set the authentication protocols. Default is "Negotiate, NTLM".- Parameters:
value
- Authentication protocols
-
sendUnauthorized
protected void sendUnauthorized(javax.servlet.http.HttpServletResponse response) Send a 401 Unauthorized along with protocol authentication headers.- Parameters:
response
- HTTP Response
-
sendError
protected void sendError(javax.servlet.http.HttpServletResponse response, int code) Send an error code.- Parameters:
response
- HTTP Responsecode
- Error Code
-
getAuthMethod
- Specified by:
getAuthMethod
in classorg.apache.catalina.authenticator.AuthenticatorBase
-
doLogin
protected Principal doLogin(org.apache.catalina.connector.Request request, String username, String password) throws javax.servlet.ServletException - Overrides:
doLogin
in classorg.apache.catalina.authenticator.AuthenticatorBase
- Throws:
javax.servlet.ServletException
-
createPrincipal
protected org.apache.catalina.realm.GenericPrincipal createPrincipal(IWindowsIdentity windowsIdentity) This method will create an instance of a IWindowsIdentity based GenericPrincipal. It is used for creating custom implementation within subclasses.- Parameters:
windowsIdentity
- the windows identity to initialize the principal- Returns:
- the Generic Principal
-