public abstract class HttpAuthenticationLoginPage
extends org.apache.wicket.markup.html.WebPage
ENABLE, FLAG_AFTER_RENDERING, FLAG_INITIALIZED, FLAG_PREPARED_FOR_RENDER, FLAG_REMOVING_FROM_HIERARCHY, FLAG_RENDERING, FLAG_RESERVED1, FLAG_RESERVED2, FLAG_RESERVED3, FLAG_RESERVED4, FLAG_RESERVED5, FLAG_RESERVED8, PARENT_PATH, PATH_SEPARATOR, RENDER, RFLAG_CONTAINER_DEQUEING
Modifier | Constructor and Description |
---|---|
|
HttpAuthenticationLoginPage()
Basic constructor.
|
protected |
HttpAuthenticationLoginPage(org.apache.wicket.model.IModel<?> model)
Constructor.
|
protected |
HttpAuthenticationLoginPage(org.apache.wicket.request.mapper.parameter.PageParameters parameters)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addBasicHeaders(org.apache.wicket.request.http.WebRequest request,
org.apache.wicket.request.http.WebResponse response)
Adds a "WWW-Authenticate" header for basic authentication to the response.
|
protected void |
configureResponse(org.apache.wicket.request.http.WebResponse response) |
protected void |
doAuthentication()
Sets a flag to handle authentication headers and sets response to request authentication if
required.
|
protected abstract Object |
getBasicLoginContext(String username,
String password)
Delivers a context suitable for logging in with the specified username and password.
|
abstract String |
getRealm(org.apache.wicket.request.http.WebRequest request,
org.apache.wicket.request.http.WebResponse response)
The authentication realm.
|
protected void |
handleAuthentication(org.apache.wicket.request.http.WebRequest request,
org.apache.wicket.request.http.WebResponse response,
String scheme,
String param)
Delegates authentication.
|
protected boolean |
handleBasicAuthentication(org.apache.wicket.request.http.WebRequest request,
org.apache.wicket.request.http.WebResponse response,
String scheme,
String param)
Handles authentication for the "Basic" scheme.
|
protected boolean |
isAuthenticated()
Check if already someone is authenticated to prevent duplicate logins.
|
protected void |
requestAuthentication(org.apache.wicket.request.http.WebRequest request,
org.apache.wicket.request.http.WebResponse response)
Sets the statuscode of the response to 401.
|
getMarkupType, homePageLink, onAfterRender, onRender, renderXmlDecl, reportMissingHead, setHeaders, setNextAvailableId
componentChanged, componentRendered, detachModels, dirty, dirty, endComponentRender, getAutoIndex, getId, getPageClass, getPageId, getPageParameters, getPageReference, getRenderCount, getSizeInBytes, getStatelessHint, hierarchyAsString, internalOnModelChanged, internalPrepareForRender, isBookmarkable, isErrorPage, isPageStateless, onBeforeRender, onDetach, onInitialize, renderPage, setFreezePageId, setNumericId, setStatelessHint, setWasCreatedBookmarkable, startComponentRender, toString, wasCreatedBookmarkable, wasRendered
add, addDequeuedComponent, addOrReplace, autoAdd, canDequeueTag, contains, dequeue, dequeue, dequeuePreamble, findComponentToDequeue, get, get, getAssociatedMarkup, getAssociatedMarkupStream, getMarkup, getRegionMarkup, internalAdd, internalInitialize, iterator, iterator, newDequeueContext, onAfterRenderChildren, onComponentTagBody, queue, remove, remove, removeAll, renderAll, renderAssociatedMarkup, renderNext, replace, setDefaultModel, size, swap, toString, visitChildren, visitChildren, visitChildren, visitChildren
add, addStateChange, afterRender, beforeRender, canCallListenerInterface, canCallListenerInterfaceAfterExpiry, checkComponentTag, checkComponentTagAttribute, checkHierarchyChange, clearOriginalDestination, configure, continueToOriginalDestination, debug, detach, detachModel, determineVisibility, error, exceptionMessage, fatal, findMarkupStream, findPage, findParent, findParentWithAssociatedMarkup, getAjaxRegionMarkupId, getApplication, getBehaviorById, getBehaviorId, getBehaviors, getBehaviors, getClassRelativePath, getConverter, getDefaultModel, getDefaultModelObject, getDefaultModelObjectAsString, getDefaultModelObjectAsString, getEscapeModelStrings, getFeedbackMessages, getFlag, getInnermostModel, getInnermostModel, getLocale, getLocalizer, getMarkup, getMarkupAttributes, getMarkupId, getMarkupId, getMarkupIdFromMarkup, getMarkupIdImpl, getMarkupSourcingStrategy, getMetaData, getModelComparator, getOutputMarkupId, getOutputMarkupPlaceholderTag, getPage, getPageRelativePath, getParent, getPath, getRenderBodyOnly, getRequest, getRequestCycle, getRequestFlag, getResponse, getSession, getString, getString, getString, getStyle, getVariation, hasBeenRendered, hasErrorMessage, hasFeedbackMessage, info, initModel, internalRenderComponent, internalRenderHead, isActionAuthorized, isAuto, isBehaviorAccepted, isEnableAllowed, isEnabled, isEnabledInHierarchy, isIgnoreAttributeModifier, isRenderAllowed, isStateless, isVersioned, isVisibilityAllowed, isVisible, isVisibleInHierarchy, markRendering, modelChanged, modelChanging, newMarkupSourcingStrategy, onComponentTag, onConfigure, onEvent, onModelChanged, onModelChanging, onReAdd, onRemove, prepareForRender, redirectToInterceptPage, remove, remove, render, renderComponentTag, rendered, renderHead, renderHead, renderPlaceholderTag, replaceComponentTagBody, replaceWith, sameInnermostModel, sameInnermostModel, send, setAuto, setDefaultModelObject, setEnabled, setEscapeModelStrings, setFlag, setIgnoreAttributeModifier, setMarkup, setMarkupId, setMarkupIdImpl, setMetaData, setOutputMarkupId, setOutputMarkupPlaceholderTag, setParent, setRenderBodyOnly, setRequestFlag, setResponsePage, setResponsePage, setResponsePage, setVersioned, setVisibilityAllowed, setVisible, success, urlFor, urlFor, urlFor, urlFor, urlFor, visitParents, visitParents, warn, wrap
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
public HttpAuthenticationLoginPage()
WebPage.WebPage()
protected HttpAuthenticationLoginPage(org.apache.wicket.model.IModel<?> model)
model
- WebPage.WebPage(IModel)
protected HttpAuthenticationLoginPage(org.apache.wicket.request.mapper.parameter.PageParameters parameters)
parameters
- WebPage.WebPage(PageParameters)
protected void configureResponse(org.apache.wicket.request.http.WebResponse response)
configureResponse
in class org.apache.wicket.markup.html.WebPage
protected final void doAuthentication()
Link.onClick()
or Form.onSubmit()
protected void requestAuthentication(org.apache.wicket.request.http.WebRequest request, org.apache.wicket.request.http.WebResponse response)
addBasicHeaders(WebRequest, WebResponse)
. Subclasses should override this method to
set their custom headers.request
- response
- protected void addBasicHeaders(org.apache.wicket.request.http.WebRequest request, org.apache.wicket.request.http.WebResponse response)
request
- response
- public abstract String getRealm(org.apache.wicket.request.http.WebRequest request, org.apache.wicket.request.http.WebResponse response)
request
- response
- protected void handleAuthentication(org.apache.wicket.request.http.WebRequest request, org.apache.wicket.request.http.WebResponse response, String scheme, String param) throws LoginException
handleBasicAuthentication(WebRequest, WebResponse, String, String)
) if processing
should continue or throw an exception.request
- response
- scheme
- the authentication scheme like "Basic" or "Digest"param
- the parameters after the scheme from the headerLoginException
- if the user could not be logged in.org.apache.wicket.RestartResponseAtInterceptPageException
- to an AccessDeniedPage
if the scheme is not supportedprotected boolean handleBasicAuthentication(org.apache.wicket.request.http.WebRequest request, org.apache.wicket.request.http.WebResponse response, String scheme, String param) throws LoginException
request
- response
- scheme
- param
- username:password in base 64LoginException
- If the supplied credentials do not grant enough credits for the requested
resourceorg.apache.wicket.RestartResponseAtInterceptPageException
- to the home page if the login was successfull but when there is no page to
continue to.protected boolean isAuthenticated()
protected abstract Object getBasicLoginContext(String username, String password)
username
- password
- Copyright © 2015. All rights reserved.