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

David73
David73
Community Member
edited May 2020 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

Comments

  • felix_1p
    felix_1p
    1Password Alumni

    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"
    
This discussion has been closed.