public class RequestAuthenticationHandler extends GenericAuthentificationHandler
Example : Forward the "username" session attribute as "X-ATTR-username" in the request fetching remote content.
Configuration uses the following attributes from driver.properties :
Constructor and Description |
---|
RequestAuthenticationHandler() |
Modifier and Type | Method and Description |
---|---|
boolean |
beforeProxy(org.apache.http.HttpRequest httpRequest)
Method called before proxying a request
This method can ask the users credentials by sending an authentication page or a 401 code or redirect to a login
page.
|
void |
init(Properties properties) |
boolean |
needsNewRequest(org.apache.http.HttpResponse response,
OutgoingRequest outgoingRequest,
IncomingRequest incomingRequest)
Method called after the response has been obtained from the destination server.
|
void |
preRequest(OutgoingRequest request,
IncomingRequest httpRequest)
Method called before sending a request to the destination server.
|
event, getDriver, init
public boolean beforeProxy(org.apache.http.HttpRequest httpRequest)
GenericAuthentificationHandler
beforeProxy
in class GenericAuthentificationHandler
httpRequest
- the incoming requestpublic void init(Properties properties)
init
in class GenericAuthentificationHandler
public boolean needsNewRequest(org.apache.http.HttpResponse response, OutgoingRequest outgoingRequest, IncomingRequest incomingRequest)
GenericAuthentificationHandler
needsNewRequest
in class GenericAuthentificationHandler
public void preRequest(OutgoingRequest request, IncomingRequest httpRequest)
GenericAuthentificationHandler
preRequest
in class GenericAuthentificationHandler
Copyright © 2008–2018. All rights reserved.