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->IsAuthenticated())
cout << "authclient: auth socket: OK" << endl;
else
cout << "authclient: auth socket: failed" << endl;
s->GetSecContext()->DeActivate(
"R");
}
}
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...
const char * Data() const
TString & Remove(Ssiz_t pos)
This class represents a WWW compatible URL.
const char * GetUser() const
const char * GetHost() const
static constexpr double s
- Author
Definition in file authclient.C.