| Package | com.kaazing.gateway.client.security |
| Class | public class ChallengeHandlers |
ChallengeHandler instances
and managing a concept of a default challenge handler.
ChallengeHandlers, a challenge handler implementation
should be installed as default implementation of an abstract challenge handler class. For
example,
ChallengeHandlers.setDefaultImplementation(BasicChallengeHandler, MyCustomBasicHandler);
var handler: ChallengeHandler = ChallengeHandlers.load(BasicChallengeHandler);
// handler is an instance of class MyCustomBasicHandler
BasicChallengeHandler
and DispatchChallengeHandler.
null).
The internal default handler cannot handle any challenges - it is up to the application to install its own
default challenge handler for any challenge management to operate at all.
Clients with a single challenge handling strategy for all authentication challenges can simply set
a specific challenge handler as the default using setDefault().
For example, to register a BasicChallengeHandler
object to handle all authentication requests by default, one can code:
var loginHandler:LoginHandler = ...
ChallengeHandlers.setDefault((ChallengeHandlers.load(BasicChallengeHandler.class) as BasicChallengeHandler)
.setLoginHandler(loginHandler));
Clients with location-specific challenge handling strategies for location-dependent authentication challenges can
register a DispatchChallengeHandler object, upon which location-specific ChallengeHandler
objects are then registered. This arrangement means that
whenever a request that matches one of the specific locations encounters an authentication challenge from the server,
the corresponding ChallengeHandler
object is invoked to handle the challenge.
LoginHandler loginHandler = ...
ChallengeHandlers.setDefault(ChallengeHandlers.load(DispatchChallengeHandler.class)
.register("ws://my.server.com", ChallengeHandlers.load(BasicChallengeHandler.class)
.setLoginHandler(loginHandler)
)
);
See also
| Method | Defined by | ||
|---|---|---|---|
|
[static]
Get a reference to the default challenge handler to be used for all HTTP requests
| ChallengeHandlers | ||
|
load(clazz:Class):*
[static]
Find and instantiate a challenge handler by the class of
ChallengeHandler. | ChallengeHandlers | ||
|
loadByName(className:String):*
[static]
Find and instantiate a challenge handler by the String name of a class of
ChallengeHandler. | ChallengeHandlers | ||
|
setDefault(challengeHandler:ChallengeHandler):void
[static]
Define the default challenge handler to be used for all HTTP requests.
| ChallengeHandlers | ||
|
setDefaultImplementation(abstractClass:Class, implementationClass:Class):void
[static]
Set the default implementation of an abstract Challenge Handler class.
| ChallengeHandlers | ||
|
setDefaultImplementationByName(abstractClass:Class, implementationClassName:String):void
[static]
Set the default implementation of an abstract Challenge Handler class.
| ChallengeHandlers | ||
| getDefault | () | method |
public static function getDefault():ChallengeHandlerGet a reference to the default challenge handler to be used for all HTTP requests
ReturnsChallengeHandler —
a reference to the default challenge handler to be used for all HTTP requests.
|
| load | () | method |
public static function load(clazz:Class):*
Find and instantiate a challenge handler by the class of ChallengeHandler.
clazz:Class — the desired class of challenge handler
|
* — the appropriate ChallengeHandler , or null if no such handler can be found.
|
| loadByName | () | method |
public static function loadByName(className:String):*
Find and instantiate a challenge handler by the String name of a class of ChallengeHandler.
className:String — the fully-qualified String name of the desired class of challenge handler
|
* — the appropriate ChallengeHandler , or null if no such handler can be found.
|
| setDefault | () | method |
public static function setDefault(challengeHandler:ChallengeHandler):voidDefine the default challenge handler to be used for all HTTP requests.
ParameterschallengeHandler:ChallengeHandler — use this challenge handler as the default for all HTTP requests.
|
| setDefaultImplementation | () | method |
public static function setDefaultImplementation(abstractClass:Class, implementationClass:Class):voidSet the default implementation of an abstract Challenge Handler class. Used to load instances of appropriate concrete subclasses
ParametersabstractClass:Class — the abstract class corresponding to the type of ChallengeHandler required
|
|
implementationClass:Class — the concrete class to be instantiated when an instance of the abstract class is desired
|
| setDefaultImplementationByName | () | method |
public static function setDefaultImplementationByName(abstractClass:Class, implementationClassName:String):voidSet the default implementation of an abstract Challenge Handler class. Used to load instances of appropriate concrete subclasses
ParametersabstractClass:Class — the abstract class corresponding to the type of ChallengeHandler required
|
|
implementationClassName:String — the name of the concrete class to be instantiated when an instance of the abstract class is desired
|