My mfa otp works fine on the GUI client but no the cli

NoellaNoella
edited December 2021 in CLI

I have an mfa setup for an AWS account and this works perfectly fine on the GUI.

However if I try and get my otp through the 1password cli I keep getting this error

op get totp AWS
[ERROR] 2021/12/02 22:48:23 Item AWS does not contain a one-time password

For what its worth I am able to access the item json itself and individual fields like my password using --fields password through the CLI without a problem.

Any help is appreciated, thanks!


1Password Version: 7.9.1
Extension Version: Not Provided
OS Version: 11.6

Comments

  • ag_anaag_ana 1Password Alumni

    Hi @Noella!

    As far as I know, all CLI commands needs the item UUID, not its name. Can you try using the UUID and see if you still get the error message?

  • Hey @ag_ana, Thanks for the reply! I just tried that and I see the same behavior.

    op get totp [uuid]
    [ERROR] 2021/12/03 23:58:09 Item [uuid] does not contain a one-time password

    And again

    op get item [uuid]

    returns the json as expected

  • artem1Partem1P

    Team Member

    Hi @Noella,

    When you retrieve the item using op get item [uuid] , does the json contain a field where the "t" field is "t": "one-time password", and the "n" field has the prefix "TOTP_"?

    This is how the CLI looks for the TOTP field when you call op get totp.

    Looking forward to hearing back,

    Artem

  • Aha! It appears there might be two 'entries' for the field somehow and maybe the bad ones getting picked up..

    "sections": [
    {
    "name": "linked items",
    "title": "Related Items"
    },
    {
    "fields": [
    {
    "k": "concealed",
    "n": "TOTP_7891E0D72B4D4AC3AB5ED886502005D2",
    "t": "",
    "v": ""
    }
    ],
    "name": "Section_96AAD171D36149E4BA225A2083E2C397",
    "title": ""
    },
    {
    "name": "Section_94B38591D3944DA998C2C21BD22B4E5F",
    "title": ""
    },
    {
    "fields": [
    {
    "k": "concealed",
    "n": "TOTP_E078830575474EF0AA35A3605DF1D285",
    "t": "one-time password",
    "v": "otpauth://totp/Amazon%20Web%20Services .."
    }
    ],
    "name": "Section_E6EBC90F13334337B425021707672F65",
    "title": ""
    }

  • Just to close the loop on this! After I deleted and recreated the physical entry for this login in 1password I'm getting the OTP fine. Thanks for all your help!

  • ag_anaag_ana 1Password Alumni

    Thank you for the update @Noella! That is good to hear :) If you have any other questions, please feel free to reach out anytime.

    Have a wonderful day :)

Leave a Comment

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