Perforce Public Knowledge Base - Authenticate with the review daemon script if an auth trigger is used.
Downloads Blog Company Integrations Careers Contact Try Free
Menu Search
Reset Search



Authenticate with the review daemon script if an auth trigger is used.

« Go Back



The Perforce Review Daemon is written in Python and obtains the needed Perforce variables from the Review Daemon's environment.  However, when a Perforce auth trigger is used to provide external authentication to the Perforce server, the Perforce server security level is set to 3 by default. The result is the "P4PASSWD" variable as set in the environment is ignored.


Prior to implementing an auth trigger, the script might have used the following example code to log in as a Perforce user:

os.environ['P4PORT'] = 'server:1666'
os.environ['P4USER'] = 'p4_user_name_here'
os.environ['P4PASSWD'] = 'p4_passwd_here'

After the auth trigger is set, the script needs to be changed to authenticate as a Perforce user using "p4 login". Change (or comment out) the P4PASSWD line and add:

os.system('echo the_password | p4 login')

Replacing "the_password" with the password for the user running the Review Daemon. The resulting code now looks similar to:

os.environ['P4PORT'] = 'server:1666'
os.environ['P4USER'] = 'p4_user_name_here'
os.system('echo the_password | p4 login')

Note: This is a potential security risk as it exposes the review user's password as plain text. If security is a concern, consider using a long login timeout ticket instead.

Related Links



Was this article helpful?



Please tell us how we can make this article more useful.

Characters Remaining: 255