|
OpenTop 1.3 | |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | Cross-Platform C++ | ||||
SUMMARY: CONSTRUCTOR | METHOD | DETAIL: CONSTRUCTOR | METHOD |
#include "ot/net/Authenticator.h"
OpenTop does not create a default Authenticator, so the default action is for access requests for authenticated services to be denied. However, an example implementation of the Authenticator interface is provided by the NetAccessHelper class.
Applications use Authenticator by creating a derived class, and registering an instance of that class using the SetDefault() method. When authentication is required, the network component calls RequestPasswordAuthentication() which delegates the request to the registered Authenticator.
Method Summary | |
protected virtual bool |
getPasswordAuthentication(InetAddress* pAddr, int port, const String& protocol, const String& prompt, const String& scheme, bool bProxy, String& userRet, String& passwordRet)=0 Called when password authorization is needed. |
static bool |
RequestPasswordAuthentication(InetAddress* pAddr, int port, const String& protocol, const String& prompt, const String& scheme, bool bProxy, String& userRet, String& passwordRet) Static method that simply passes the request to the registered global Authenticator (if any). |
static void |
SetDefault(Authenticator* pAuthenticator) Sets the default (and global) Authenticator for the application. |
Methods inherited from class ot::ManagedObject |
addRef, getRefCount, onFinalRelease, operator=, release |
Method Detail |
protected virtual bool getPasswordAuthentication(InetAddress* pAddr, int port, const String& protocol, const String& prompt, const String& scheme, bool bProxy, String& userRet, String& passwordRet)=0
pAddr
- port
- protocol
- prompt
- scheme
- bProxy
- userRet
- passwordRet
- static bool RequestPasswordAuthentication(InetAddress* pAddr, int port, const String& protocol, const String& prompt, const String& scheme, bool bProxy, String& userRet, String& passwordRet)
pAddr
- port
- protocol
- prompt
- scheme
- bProxy
- userRet
- passwordRet
- static void SetDefault(Authenticator* pAuthenticator)
For example, the following is perfectly valid and does not present a resource leak:
Authenticator::SetDefault(new MyCustomAuthenticator);
|
OpenTop 1.3 | |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | Cross-Platform C++ | ||||
SUMMARY: CONSTRUCTOR | METHOD | DETAIL: CONSTRUCTOR | METHOD |