This macro should be run together with authserv.C to test authentication between two remote ROOT sessions.
Run first the authserv.C within a ROOT session on the server machine, eg. "srv.machi.ne":
root[] .x authserv.C(3000)
authserv accepts as argument the port where it starts listening (default 3000). You can then run authclient.c in a ROOT session on the client machine: root[] .x authclient.C("srv.machi.ne:3000")
and you should get prompted for the credentials, if the case. To start a parallel socket of size, for example, 5, enter the size as second argument, ie
root[] .x authclient.C("srv.machi.ne:3000",5)
int authclient(const char *host = "up://localhost:3000", int sz = 0)
{
Int_t par = (sz > 1) ? 1 : 0;
if (
proto.EndsWith(
"up") ||
proto.EndsWith(
"ug")) {
}
else if (
proto.EndsWith(
"s") ||
proto.EndsWith(
"k") ||
}
newurl += "://";
if (strlen(
TUrl(host).GetUser())) {
newurl += "@";
}
newurl += ":";
cout << "authclient: starting a (parallel) authenticated socket at "
<< newurl.
Data() <<
" (size: " << sz <<
")" << endl;
if (s)
cout << "authclient: auth socket: OK" << endl;
else
cout << "authclient: auth socket: failed" << endl;
if (s) {
delete s;
}
}
virtual void DeActivate(Option_t *opt="CR")
Set OffSet to -1 and expiring Date to default Remove from the list If Opt contains "C" or "c",...
TSecContext * GetSecContext() const
static TSocket * CreateAuthSocket(const char *user, const char *host, Int_t port, Int_t size=0, Int_t tcpwindowsize=-1, TSocket *s=0, Int_t *err=0)
Creates a socket or a parallel socket and authenticates to the remote server specified in 'url' on re...
virtual Bool_t IsAuthenticated() const
const char * Data() const
void Resize(Ssiz_t n)
Resize the string. Truncate or add blanks as necessary.
TString & Remove(Ssiz_t pos)
This class represents a WWW compatible URL.
const char * GetUser() const
const char * GetHost() const
- Author
Definition in file authclient.C.