First of all, I love the 1password cli and it encouraged me start developing my shell skills.
I've been trying to get op to work with my git-credential helper. I noticed that it worked if I was already logged in and used the
--session token. But if my session is expired, the script returns a 401 error;
[ERROR] 2020/11/30 10:29:28 Authentication: DB: 401: Unauthorized
I've traced it back to the input of a multiline to the command.
Let's say I have the file git-credential-op with the following code;
#!/bin/bash eval $(op signin [accountname] --session="[SessionVariable]")
When I call it like this:
git-credential-op get username=[accountname]
It works fine and asks for the password.
When I call it like this, to imitate how the credential-helper is called to my understanding;
git-credential-op get <<EOF host=[hostname] username=[accountname] EOF
I get the 401 error.
Am I doing something really wrong here, or is this a bug with op?
The only workaround I now have is to make sure I'm logged in already before calling any git commands, but that's not really long-term viable.
Thanks in advance
1Password Version: CLI 1.8.0
Extension Version: Not Provided
OS Version: Not Provided
Sync Type: Not Provided