Getting started with 1Password for your growing team, or refining your setup? Our Secured Success quickstart guide is for you.
Forum Discussion
Former Member
4 years ago[12] How do I obtain a totp value
Hello everyone,
I have a script which obtains a TOTP - value like that:
op get totp "my item name"
How do I do this with op2?
Best regards,
Micha
1Password Version: 2.0.0-beta....
Former Member
4 years agoHey @MichaelKloske ,
We are currently torn whether or not op item get <MyItem> --fields <SomeTotpField>
should be returning the totp secret, or totp value.
Currently when a totpField is specified in the --fields
flag, the totp secret will be printed. However, we are considering changing it to return the totp value instead.
This would allow users to use op item get <MyItem> --fields <aTotpField>
to retrieve just the totp value, and set it to a variable, or pipe it into commands that require the totp code.
The tradeoff here is that it would be hard to isolate just the totp secret, but given the use cases with totp values far exceeding those with totp secrets, we think that that this is a good tradeoff. The totp secret would still be accessible by retrieving the whole item, and processing it via jq
or other similar methods if isolating that secret is necessary.
We are interested in what your thoughts are here!