public class SpnegoAuthenticator extends AuthenticatorBase
AuthenticatorBase.AllowCorsPreflightLifecycle.SingleUse| Modifier and Type | Field and Description |
|---|---|
protected static Oid |
KRB5_MECHANISM |
protected Log |
logger |
protected StringManager |
sm |
protected static String |
SPNEGO_AUTH_SCHEME |
protected static Oid |
SPNEGO_MECHANISM |
protected static String |
SPNEGO_METHOD |
alwaysUseSession, AUTH_HEADER_NAME, cache, changeSessionIdOnAuthentication, context, disableProxyCaching, jaspicCallbackHandlerClass, REALM_NAME, securePagesWithPragma, secureRandomAlgorithm, secureRandomClass, secureRandomProvider, sendAuthInfoResponseHeaders, sessionIdGenerator, ssoasyncSupported, container, containerLog, nextmserverAFTER_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 and Description |
|---|
SpnegoAuthenticator() |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
doAuthenticate(Request request,
javax.servlet.http.HttpServletResponse response) |
protected String |
getAuthMethod() |
String |
getLoginEntryName()
Returns the configured login entry name.
|
boolean |
isErrorMessagesAsHeaders()
Indicates whether error messages will be responded as headers.
|
boolean |
isOmitErrorMessages()
Indicates whether error messages are responded to the client.
|
boolean |
isStoreDelegatedCredential()
Indicates whether client's (initiator's) delegated credential is stored in the user
principal.
|
protected void |
respondErrorMessage(Request request,
javax.servlet.http.HttpServletResponse response,
int statusCode,
String messageKey,
Object... params) |
protected void |
sendInternalServerError(Request request,
javax.servlet.http.HttpServletResponse response,
String messageKey,
Object... params) |
protected void |
sendUnauthorized(Request request,
javax.servlet.http.HttpServletResponse response,
String scheme) |
protected void |
sendUnauthorized(Request request,
javax.servlet.http.HttpServletResponse response,
String scheme,
String messageKey,
Object... params) |
void |
setErrorMessagesAsHeaders(boolean errorMessagesAsHeaders)
Sets whether error messages will be returned as headers.
|
void |
setLoginEntryName(String loginEntryName)
Sets the login entry name which establishes the security context.
|
void |
setOmitErrorMessages(boolean omitErrorMessages)
Sets whether error messages are responded to the client.
|
void |
setStoreDelegatedCredential(boolean storeDelegatedCredential)
Sets whether client's (initiator's) delegated credential is stored in the user principal.
|
allowCorsPreflightBypass, associate, authenticate, changeSessionID, checkForCachedAuthentication, doLogin, getAllowCorsPreflight, getAlwaysUseSession, getCache, getChangeSessionIdOnAuthentication, getContainer, getDisableProxyCaching, getJaspicCallbackHandlerClass, getRealmName, getRequestCertificates, getSecurePagesWithPragma, getSecureRandomAlgorithm, getSecureRandomClass, getSecureRandomProvider, invoke, isContinuationRequired, isSendAuthInfoResponseHeaders, login, logout, notify, reauthenticateFromSSO, register, register, setAllowCorsPreflight, setAlwaysUseSession, setCache, setChangeSessionIdOnAuthentication, setContainer, setDisableProxyCaching, setJaspicCallbackHandlerClass, setSecurePagesWithPragma, setSecureRandomAlgorithm, setSecureRandomClass, setSecureRandomProvider, setSendAuthInfoResponseHeaders, startInternal, stopInternalbackgroundProcess, getDomainInternal, getNext, getObjectNameKeyProperties, initInternal, isAsyncSupported, setAsyncSupported, setNext, toStringdestroyInternal, getDomain, getObjectName, postDeregister, postRegister, preDeregister, preRegister, register, setDomain, unregisteraddLifecycleListener, destroy, findLifecycleListeners, fireLifecycleEvent, getState, getStateName, getThrowOnFailure, init, removeLifecycleListener, setState, setState, setThrowOnFailure, start, stopprotected static final String SPNEGO_METHOD
protected static final String SPNEGO_AUTH_SCHEME
protected final Log logger
protected final StringManager sm
protected static final Oid KRB5_MECHANISM
protected static final Oid SPNEGO_MECHANISM
protected boolean doAuthenticate(Request request, javax.servlet.http.HttpServletResponse response) throws IOException
doAuthenticate in class AuthenticatorBaseIOExceptionprotected String getAuthMethod()
getAuthMethod in class AuthenticatorBasepublic void setLoginEntryName(String loginEntryName)
loginEntryName - the login entry namepublic String getLoginEntryName()
public boolean isOmitErrorMessages()
public void setOmitErrorMessages(boolean omitErrorMessages)
omitErrorMessages - indicator to error omit messagespublic boolean isErrorMessagesAsHeaders()
public void setErrorMessagesAsHeaders(boolean errorMessagesAsHeaders)
It is not always desired or necessary to produce an error page, e.g., non-human clients do
not analyze it anyway but have to consume the response (wasted time and resources). When a
client issues a request, the server will write the error messages to either one header:
Auth-Error or Server-Error.
Technically speaking, HttpServletResponse.setStatus(int) will be called instead of
HttpServletResponse.sendError(int, String).
errorMessagesAsHeaders - indicates whether error messages will be responded as headerspublic boolean isStoreDelegatedCredential()
public void setStoreDelegatedCredential(boolean storeDelegatedCredential)
storeDelegatedCredential - the store delegated credential indicationprotected void respondErrorMessage(Request request, javax.servlet.http.HttpServletResponse response, int statusCode, String messageKey, Object... params) throws IOException
IOExceptionprotected void sendInternalServerError(Request request, javax.servlet.http.HttpServletResponse response, String messageKey, Object... params) throws IOException
IOExceptionprotected void sendUnauthorized(Request request, javax.servlet.http.HttpServletResponse response, String scheme) throws IOException
IOExceptionprotected void sendUnauthorized(Request request, javax.servlet.http.HttpServletResponse response, String scheme, String messageKey, Object... params) throws IOException
IOExceptionCopyright © 2013–2020 Michael Osipov. All rights reserved.