Keeping op cli auth

Options
mickael
mickael
Community Member

Hi,

Can we still maintain an op cli session opened ?

In previous versions this was possible by quering the server with

op account get --account="XXXXX"

It looks like this is no more the case.

Any alternative ?

Thanks


1Password Version: Not Provided
Extension Version: Not Provided
OS Version: Not Provided
Browser:_ Not Provided

Comments

  • Hi @mickael. In order for a session to stay active an op command needs to be executed (at least ) every 30 minutes. op account get --acount='UUID' should still do the trick as long as account with the specified UUID already had an open session.

  • mickael
    mickael
    Community Member
    Options

    I guess at some point there is something wrong with op account get --acount='UUID' as I reported in an other subject and I finally get disconnected be cause the command is no more executed.

    Maybe I was calling that command too frequently (every 30s) and get some ban or other ?

    I noticed that the CPU usage of the process responsible for the refresh was taking a lot of CPU. I killed it and then tried to launch the command manually. Then I saw that op cli was crashing as reported in https://1password.community/discussion/comment/651306#Comment_651306.

  • mickael
    mickael
    Community Member
    Options

    It looks like I am unable to auth in scripts even if OP_ variables are defined.

    Here is the script I was using:

    #!/bin/bash
    source /etc/profile
    . "${HOME}/.bin.base/opsign.sh"
    eval $(get1PasswordSession)
    env|grep OP_
    op account get --account="BUSINESS_UUID" > /dev/null
    MY="$?"
    op account get --account="PROJECT_UUID" > /dev/null
    TEAM="$?"
    echo "$(($MY+$TEAM))"
    

    The result given is:

    OP_SESSION_hash1=key1
    OP_SESSION_hash2=key2
    2
    

    If I run the commands in a terminal it works correctly, I double checked the OP_SESSION env vars and they are the same.

    Any clue why op can't authenticate properly in script ?

This discussion has been closed.