Responsible for both loading fresh ChallengeHandler instances and managing a concept of a default challenge handler.
Managing the Default Challenge Handler: This class provides a way to get and set a default challenge handler, which is always defined (never NULL). The internal default handler cannot handle any challenges - it is up to the application to install its own default challenge handler for any authentication 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(ChallengeHandler). For example, to register a BasicChallengeHandler object to handle all authentication requests by default, one can code:
LoginHandler loginHandler = ...
BasicChallengeHandler basicHandler = ChallengeHandlers.Load<BasicChallengeHandler>(typeof(BasicChallengeHandler));
basicHandler.LoginHandler = loginHandler;
ChallengeHandlers.Default = basicHandler;
| |
Clients with location-specific challenge handling strategies for location-dependent 401 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 a 401 challenge from the server, the corresponding ChallengeHandler object is invoked to handle the challenge.
DispatchChallengeHandler dispatchHandler = ChallengeHandlers.Load<DispatchChallengeHandler>(typeof(DispatchChallengeHandler));
ChallengeHandlers.Default = dispatchHandler;
LoginHandler loginHandler = ...
//set a loginHandler for this location
BasicChallengeHandler basicHandler = ChallengeHandlers.Load<BasicChallengeHandler>(typeof(BasicChallengeHandler));
basicHandler.LoginHandler = loginHandler;
dispatchHandler.Register("ws://myserver.com/*", basicHandler);
| |
Assembly: Kaazing.Gateway (in Kaazing.Gateway.dll)
Syntax
| Visual Basic |
|---|
Public Class ChallengeHandlers |
| C# |
|---|
public class ChallengeHandlers |
| Visual C++ |
|---|
public ref class ChallengeHandlers |