Package | com.kaazing.gateway.client.security |
Class | public class BasicChallengeHandler |
Inheritance | BasicChallengeHandler ![]() |
This BasicChallengeHandler can be loaded and instantiated using ChallengeHandlers.load(clazz:Class)
,
and registered at a location using DispatchChallengeHandler.register(String, ChallengeHandler)
.
In addition, one can install general and realm-specific LoginHandler
objects onto this
BasicChallengeHandler
to assist in handling challenges associated
with any or specific realms.
The following example loads an instance of a BasicChallengeHandler
, sets a login
handler onto it and registers the basic handler at a URI location. In this way, all attempts to access
that URI for which the server issues "Basic" challenges are handled by the registered BasicChallengeHandler
.
var loginHandler:LoginHandler = new LoginHandler() { override public function getCredentials(continuation:Function):void { continuation("global", "credentials"); } }; ChallengeHandlers.setDefault((ChallengeHandlers.load(DispatchChallengeHandler.class) as DispatchChallengeHandler) .register("ws://localhost:8001", (ChallengeHandlers.load(BasicChallengeHandler.class) as BasicChallengeHandler) .setLoginHandler(loginHandler); ) );
See also
Property | Defined by | ||
---|---|---|---|
loginHandler : LoginHandler
Get the general (non-realm-specific) login handler associated with this challenge handler.
| BasicChallengeHandler |
Method | Defined by | ||
---|---|---|---|
![]() |
canHandle(challengeRequest:ChallengeRequest):Boolean
Can the presented challenge be potentially handled by this challenge handler?
| ChallengeHandler | |
defaultImplementation():String
[static]
Called to automatically discover the default implementation when loading this challenge handler.
| BasicChallengeHandler | ||
Get the general (non-realm-specific) login handler associated with this challenge handler.
| BasicChallengeHandler | ||
![]() |
Handle the presented challenge by creating a challenge response future.
| ChallengeHandler | |
Provide a general (non-realm-specific) login handler to be used in association with this challenge handler.
| BasicChallengeHandler | ||
Set a Login Handler to be used if and only if a challenge request has
a realm parameter matching the provided realm.
| BasicChallengeHandler |
loginHandler | property |
loginHandler:LoginHandler
[read-write]Get the general (non-realm-specific) login handler associated with this challenge handler. A login handler is used to assist in obtaining credentials to respond to challenge requests.
Implementation public function get loginHandler():LoginHandler
public function set loginHandler(value:LoginHandler):void
defaultImplementation | () | method |
public static function defaultImplementation():String
Called to automatically discover the default implementation when loading this challenge handler.
ReturnsString |
getLoginHandler | () | method |
public function getLoginHandler():LoginHandler
Get the general (non-realm-specific) login handler associated with this challenge handler. A login handler is used to assist in obtaining credentials to respond to challenge requests.
ReturnsLoginHandler —
a login handler to assist in providing credentials, or null if none has been established yet.
|
setLoginHandler | () | method |
public function setLoginHandler(loginHandler:LoginHandler):BasicChallengeHandler
Provide a general (non-realm-specific) login handler to be used in association with this challenge handler. The login handler is used to assist in obtaining credentials to respond to any Basic challenge requests when no realm-specific login handler matches the realm parameter of the request (if any).
ParametersloginHandler:LoginHandler — a login handler for credentials.
|
BasicChallengeHandler |
setRealmLoginHandler | () | method |
public function setRealmLoginHandler(realm:String, loginHandler:LoginHandler):BasicChallengeHandler
Set a Login Handler to be used if and only if a challenge request has a realm parameter matching the provided realm.
Parametersrealm:String — the realm upon which to apply the loginHandler .
|
|
loginHandler:LoginHandler — the login handler to use for the provided realm.
|
BasicChallengeHandler |