Skip to content

Commit

Permalink
[XrdSecztn] Allow to point to a token file using CGI '?xrd.ztn=tokenf…
Browse files Browse the repository at this point in the history
…ile'
  • Loading branch information
apeters1971 committed Feb 23, 2023
1 parent 8f5b345 commit 5663714
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/XrdSecztn/XrdSecProtocolztn.cc
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
#include "XrdVersion.hh"

#include "XrdNet/XrdNetAddrInfo.hh"
#include "XrdOuc/XrdOucEnv.hh"
#include "XrdOuc/XrdOucErrInfo.hh"
#include "XrdOuc/XrdOucPinLoader.hh"
#include "XrdOuc/XrdOucString.hh"
Expand Down Expand Up @@ -347,6 +348,16 @@ XrdSecCredentials *XrdSecProtocolztn::findToken(XrdOucErrInfo *erp,
if ((bTok = Strip(aTok, sz))) return retToken(erp, bTok, sz);
}

// We support passing the credential cache path via Url parameter
//
char *ccn = (erp && erp->getEnv()) ? erp->getEnv()->Get("xrd.ztn") : 0;
if (ccn)
{
resp = readToken(erp, ccn, isbad);
if (resp || isbad) return resp;
}

// Look through all of the possible envars
// Nothing found
//
isbad = false;
Expand Down

0 comments on commit 5663714

Please sign in to comment.