This BasicChallengeHandler can be loaded and instantiated using ChallengeHandlers.Load(), 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. This can be achieved using 'setLoginHandler(LoginHandler)' and 'setRealmLoginHandler(String, LoginHandler)' methods.
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.
![]() | |
---|---|
public class MyLoginHandler : LoginHandler { public PasswordAuthentication GetCredentials() { return new PasswordAuthentication("global", "credentials".ToCharArray()); } } BasicChallengeHandler basicHandler = ChallengeHandlers.Load<BasicChallengeHandler>(typeof(BasicChallengeHandler)); basicHandler.LoginHandler = new MyLoginHandler(); ChallengeHandlers.Default = basicHandler; |
Assembly: Kaazing.Gateway (in Kaazing.Gateway.dll)
Syntax
Visual Basic |
---|
Public MustInherit Class BasicChallengeHandler _ Inherits ChallengeHandler |
C# |
---|
public abstract class BasicChallengeHandler : ChallengeHandler |
Visual C++ |
---|
public ref class BasicChallengeHandler abstract : public ChallengeHandler |
Inheritance Hierarchy
Kaazing.Security..::..ChallengeHandler
Kaazing.Security..::..BasicChallengeHandler