using --session token inside an app returns not signed in error

edited May 14 in CLI

I'm developing a Java application where I'm hoping to retrieve the MFA code for a particular login object.
I'm successfully retrieving the token by using "op signing mydomain -- raw" but when I then use the token immediately afterwards in the code using:
"op get totp 'account object' -- session token" I get the message:

"You are not currently signed in. Please run op signin --help for instructions"

Is there something obvious that I'm missing here, trying the same commands directly in the terminal returns the correct mfa code?

1Password Version: 7.5
Extension Version: Not Provided
OS Version: Osx 10.15.4
Sync Type: Not Provided


  • felix_1pfelix_1p

    Team Member

    Hi @David73! Which version of the command line tool are you using? In your post there is a space between -- and session, which would be wrong, but that might just be in the post here.

    The following works as expected for me:

    $ token=$(op signin  account --raw)
    Enter the password for ... at ...: 
    $ op get item ... --session "$token"

Leave a Comment

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