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.AllowCorsPreflightNested classes/interfaces inherited from interface org.apache.catalina.Lifecycle
org.apache.catalina.Lifecycle.SingleUse -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanThe allow guest login.protected IWindowsAuthProviderThe auth.protected intThe auth continueContextsTimeout configuration.protected StringThe info.protected org.slf4j.LoggerThe log.protected PrincipalFormatThe principal format.The protocols.protected PrincipalFormatThe 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, ssoFields inherited from class org.apache.catalina.valves.ValveBase
asyncSupported, container, containerLog, nextFields 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanauthenticate(org.apache.catalina.connector.Request request, javax.servlet.http.HttpServletResponse response) protected org.apache.catalina.realm.GenericPrincipalcreatePrincipal(IWindowsIdentity windowsIdentity) This method will create an instance of a IWindowsIdentity based GenericPrincipal.protected booleandoAuthenticate(org.apache.catalina.connector.Request request, javax.servlet.http.HttpServletResponse response) XXX The 'doAuthenticate' is intended to replace 'authenticate' for needs like ours.protected PrincipalgetAuth()Windows authentication provider.protected StringintGets the continue context time out configuration.getInfo()Gets the info.Principal format.Principal format.booleanTrue if Guest login permitted.protected voidsendError(javax.servlet.http.HttpServletResponse response, int code) Send an error code.protected voidsendUnauthorized(javax.servlet.http.HttpServletResponse response) Send a 401 Unauthorized along with protocol authentication headers.voidsetAllowGuestLogin(boolean value) Set whether Guest login is permitted.voidsetAuth(IWindowsAuthProvider provider) Set Windows auth provider.voidsetContinueContextsTimeout(int continueContextsTimeout) Sets the continue context time out configuration.voidsetPrincipalFormat(String format) Set the principal format.voidsetProtocols(String value) Set the authentication protocols.voidsetRoleFormat(String format) Set the principal format.voidHook to the start and to set up the dependencies.voidMethods 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, setSendAuthInfoResponseHeadersMethods inherited from class org.apache.catalina.valves.ValveBase
backgroundProcess, getDomainInternal, getNext, getObjectNameKeyProperties, initInternal, isAsyncSupported, setAsyncSupported, setNext, toStringMethods inherited from class org.apache.catalina.util.LifecycleMBeanBase
destroyInternal, getDomain, getObjectName, postDeregister, postRegister, preDeregister, preRegister, register, setDomain, unregister, unregisterMethods 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:
stopInternalin 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:
getAuthMethodin classorg.apache.catalina.authenticator.AuthenticatorBase
-
doLogin
protected Principal doLogin(org.apache.catalina.connector.Request request, String username, String password) throws javax.servlet.ServletException - Overrides:
doLoginin 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
-