Jump to content


Automatic login with P4PASSWD when authenticating against AD

login

  • Please log in to reply
3 replies to this topic

#1 silvester747

silvester747

    Member

  • Members
  • PipPip
  • 24 posts

Posted 11 April 2013 - 11:36 AM

On one of my test servers I am trying to automatically log in to P4 to do a sync. However all described methods, seem to be failing.

I have tried the following values for P4PASSWD:
- plain text password
- md5 hash of password
- output of p4 login -p

If I now do p4 login, I am still prompted for a password.

I also tried p4 -P <password> login (with all 3 options above), but still I am prompted for a password.

What am I doing wrong?

#2 P4Sam

P4Sam

    Advanced Member

  • Members
  • PipPipPip
  • 484 posts
  • LocationSan Francisco, CA

Posted 11 April 2013 - 09:20 PM

If you're using external authentication (e.g. AD) you can never use the password to authenticate directly; the password has to be checked against AD, and the only way to do that is to run "p4 login" and enter the password.  If AD approves the password, the Perforce server will in turn issue you a login ticket that will last as long as your group's Timeout permits.

If you already have a valid ticket (e.g. the output of "p4 login -p", or just the result of what a normal "p4 login" writes to your tickets file), you do not need to run "p4 login" again; just run your command.  If the ticket is in your tickets file already, the command should just work; if you for some reason can't use a tickets file and need to pass the ticket on the command line, "p4 -P <ticket> sync" should do the trick.

#3 P4Matt

P4Matt

    Advanced Member

  • Members
  • PipPipPip
  • 1383 posts

Posted 11 April 2013 - 09:56 PM

To add to that, if you are looking to do this for an automated process you may want to create a special user for the script that is a member of a group where the login is configured to never time out. Perforce licensing can give you a free background user to use for scripts.

#4 silvester747

silvester747

    Member

  • Members
  • PipPip
  • 24 posts

Posted 12 April 2013 - 06:34 AM

Thanks, this explains a lot. I will request for a special user that does not time out and start using the tickets.





Also tagged with one or more of these keywords: login

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users