public abstract class GatewayChallengeHandler extends BaseChallengeHandler implements WLResponseListener
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_TIMEOUT_IN_MILLISECONDS |
activeRequest
Constructor and Description |
---|
GatewayChallengeHandler(java.lang.String gatewayName)
Constructs an GatewayChallengeHandler with a specific 'gatewayName'.
|
Modifier and Type | Method and Description |
---|---|
abstract boolean |
canHandleResponse(WLResponse response)
This method must be overridden by extending the
GatewayChallengeHandler class. |
protected void |
submitLoginForm(java.lang.String requestURL,
java.util.Map requestParameters,
java.util.Map requestHeaders,
int requestTimeoutInMilliseconds,
java.lang.String requestMethod)
You use this method to send collected credentials to a specific URL.
|
protected void |
submitSuccess(WLResponse response)
You must call this method when the challenge is answered successfully, for example after the user successfully submits the login form.
|
cancel, handleChallenge
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
onFailure, onSuccess
public GatewayChallengeHandler(java.lang.String gatewayName)
protected void submitSuccess(WLResponse response)
response
- The received WLResponse
.public abstract boolean canHandleResponse(WLResponse response)
GatewayChallengeHandler
class. In most cases,
you call this method to test whether there is a gateway challenge to be handled in the response.
If the method returns true, the IBM MobileFirst Platform calls the BaseChallengeHandler.handleChallenge(Object)
method.response
- The response to be tested.protected void submitLoginForm(java.lang.String requestURL, java.util.Map requestParameters, java.util.Map requestHeaders, int requestTimeoutInMilliseconds, java.lang.String requestMethod)
GatewayChallengeHandler
),
so you must override the WLResponseListener.onSuccess(WLResponse)
/ WLResponseListener.onFailure(com.worklight.wlclient.api.WLFailResponse)
methods.requestURL
- Absolute URL if the user sends an absolute URL that starts with http:// or https://
Otherwise, URL relative to the MobileFirst Platform Server.requestParameters
- The request parameters.requestHeaders
- The request headers.requestTimeoutInMilliseconds
- To supply custom timeout, use a number over 0.requestMethod
- The HTTP method that you must use.
© Copyright IBM Corp. 2006, 2015. All Rights Reserved.