Using CLI to build a crude app for taking a form submission and saving into a vault

I frequently need to ask my customers for their passwords. I thought that perhaps building a basic form in my client portal where they enter username and password would help a lot.

How would I go about using PHP (exec() maybe?) to take a form's submission and store it into my vault?

I've been able to log in using ./op via the terminal, and list items successfully, but that's as far as I have gotten. I couldn't even figure out how to sign in via a PHP script.


1Password Version: Not Provided
Extension Version: Not Provided
OS Version: Not Provided
Sync Type: Not Provided

Comments

  • cohixcohix

    Team Member

    @jeff_ripplepop Using exec would work! I'm not very familiar with PHP anymore (it's been years!) But you should be able to use op signin [address] [email] [secretkey] --output=raw to get a session token, and then with any other op command, you can pass that token in using --session=[token] to authorize that command.

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file