I would like to retrieve my appstoreconnect.apple.com username and password from macOS Keychain, to write a script with those credentials afterwards.
When I type security find-internet-password -s "appstoreconnect.apple.com" -g
i get
keychain: "/Users/me/Library/Keychains/login.keychain-db"
version: 512
class: "inet"
attributes:
0x00000007 <blob>="appstoreconnect.apple.com"
0x00000008 <blob>=<NULL>
"acct"<blob>="my-username"
"atyp"<blob>="dflt"
"cdat"<timedate>=0x32303230303731363133343131315A00 "20200716134111Z\000"
"crtr"<uint32>=<NULL>
"cusi"<sint32>=<NULL>
"desc"<blob>=<NULL>
"icmt"<blob>=<NULL>
"invi"<sint32>=<NULL>
"mdat"<timedate>=0x32303230303731363133343533395A00 "20200716134539Z\000"
"nega"<sint32>=<NULL>
"path"<blob>="/"
"port"<uint32>=0x00000000
"prot"<blob>=<NULL>
"ptcl"<uint32>="htps"
"scrp"<sint32>=<NULL>
"sdmn"<blob>=<NULL>
"srvr"<blob>="appstoreconnect.apple.com"
"type"<uint32>=<NULL>
password: "my-password"
how, from that, can I retrieve my-username
and my-password
values, to use as variables in my shell script ?
try
security find-internet-password -s "appstoreconnect.apple.com" -g | grep -E "acct|password" | rev | cut -d'"' -f2 | rev
User contributions licensed under CC BY-SA 3.0