Package io.milton.http.http11.auth
Class LoginResponseHandler
java.lang.Object
io.milton.http.AbstractWrappingResponseHandler
io.milton.http.http11.auth.LoginResponseHandler
- All Implemented Interfaces:
Bufferable,ETagGenerator,Http11ResponseHandler,WebDavResponseHandler
This decorates a wrapped response handler, and gives it the ability to
generate login pages. When activated, this will suppress the http
authorisation status code and instead render a login page.
Note that the conditions under which a login page is produced in place of a
http challenge are quite specific and should not interfere with non web
browser user agents.
This will usually be used together with FormAuthenticationHandler and
CookieAuthenticationHandler to provide a complete authentication mechanism
integrated into the normal milton life cycle
- Author:
- brad
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classDefault implementation which uses some sensible rules about content types etcstatic interface -
Field Summary
FieldsFields inherited from class io.milton.http.AbstractWrappingResponseHandler
wrapped -
Constructor Summary
ConstructorsConstructorDescriptionLoginResponseHandler(WebDavResponseHandler wrapped, ResourceFactory resourceFactory, LoginResponseHandler.LoginPageTypeHandler loginPageTypeHandler) -
Method Summary
Modifier and TypeMethodDescriptionbooleanvoidrespondUnauthorised(Resource resource, Response response, Request request) If responding with a login page, the request attribute "authReason" is set to either "required", indicating that the user must login; or "notPermitted" indicating that the user is currently logged in but does not have permissionstatic voidCalled when authentication has detected a user type which is not compatible with form authentication.voidsetEnabled(boolean enabled) voidsetExcludePaths(List<String> excludePaths) voidsetLoginPage(String loginPage) Methods inherited from class io.milton.http.AbstractWrappingResponseHandler
generateEtag, getBuffering, getWrapped, respondBadRequest, respondConflict, respondContent, respondCreated, respondDeleteFailed, respondExpectationFailed, respondForbidden, respondHead, respondInsufficientStorage, respondLocked, respondMethodNotAllowed, respondMethodNotImplemented, respondNoContent, respondNotFound, respondNotModified, respondPartialContent, respondPartialContent, respondPreconditionFailed, respondPropFind, respondPropFind, respondRedirect, respondServerError, respondWithOptions, responseMultiStatus, setBuffering, setWrapped
-
Field Details
-
ATT_DISABLE
- See Also:
-
-
Constructor Details
-
LoginResponseHandler
public LoginResponseHandler(WebDavResponseHandler wrapped, ResourceFactory resourceFactory, LoginResponseHandler.LoginPageTypeHandler loginPageTypeHandler)
-
-
Method Details
-
setDisableHtmlResponse
Called when authentication has detected a user type which is not compatible with form authentication. This will prevent a html form being presented, so the user will be forced to login via Basic or Diget- Parameters:
r-
-
respondUnauthorised
If responding with a login page, the request attribute "authReason" is set to either "required", indicating that the user must login; or "notPermitted" indicating that the user is currently logged in but does not have permission- Specified by:
respondUnauthorisedin interfaceHttp11ResponseHandler- Overrides:
respondUnauthorisedin classAbstractWrappingResponseHandler- Parameters:
resource-response-request-
-
getLoginPage
-
setLoginPage
-
getResourceFactory
-
getExcludePaths
-
setExcludePaths
-
isEnabled
public boolean isEnabled() -
setEnabled
public void setEnabled(boolean enabled)
-