28 int authclient(
const char *host =
"up://localhost:3000",
int sz = 0)
30 Int_t par = (sz > 1) ? 1 : 0;
33 TString proto(TUrl(host).GetProtocol());
34 TString protosave = proto;
38 if (proto.EndsWith(
"up") || proto.EndsWith(
"ug")) {
39 asfx.Remove(0,proto.Length()-2);
40 proto.Resize(proto.Length()-2);
41 }
else if (proto.EndsWith(
"s") || proto.EndsWith(
"k") ||
42 proto.EndsWith(
"g") || proto.EndsWith(
"h")) {
43 asfx.Remove(0,proto.Length()-1);
44 proto.Resize(proto.Length()-1);
48 TString newurl =
"p" + asfx;
50 if (strlen(TUrl(host).GetUser())) {
51 newurl += TUrl(host).GetUser();
54 newurl += TUrl(host).GetHost();
56 newurl += TUrl(host).GetPort();
58 cout <<
"authclient: starting a (parallel) authenticated socket at "
59 << newurl.Data() <<
" (size: " << sz <<
")" << endl;
61 TSocket *s = TSocket::CreateAuthSocket(newurl.Data(),sz);
65 if (s->IsAuthenticated())
66 cout <<
"authclient: auth socket: OK" << endl;
68 cout <<
"authclient: auth socket: failed" << endl;
74 s->GetSecContext()->DeActivate(
"R");