Skip to content

Returning onepassword.MissingCredentials Error #72

@SaltireSequence

Description

@SaltireSequence

Appreciating this is for bugs, and not StackOverflow...I am unsure if 'unofficial' Windows support was added in 01/06 release, so raising this as a 'potential' issue.

My function (fully functioning on Mac

from onepassword import OnePassword

def authenticate(base_endpoint, api_key, api_secret):
    op = OnePassword()
    # Getting vault list
    available_vaults = op.list_vaults()
   
    # Searching for Employee Vault
    employee_vault = next((vault for vault in available_vaults if vault["name"] == "Employee"), None)
    
    # Getting Employee Vault ID
    items = op.list_items(vault=employee_vault["id"])
    
    # Searching for Addepar API item in Employee vault
    addepar_item = next((item for item in items if item["title"] == "Addepar API"), None)
    
    # Getting Addepar API item details
    item_details = op.get_item(uuid=addepar_item["id"], fields=["username", "credential"])
    
    # Saving item credentials in variables for API usage
    api_key = item_details["username"]
    api_secret = item_details["credential"]

Getting the following on Windows (works fine on Mac) so unsure if a Windows or install issue (please close if so) -

Traceback

File "C:\Users\william\PyCharmProjects\CLIProject\.venv\lib\site-packages\onepassword.py, line 53, in __init__
raise MissingCredentials()
onepassword.MissingCredentials

Traceback Reference
This looks to be referencing the class OnePassword(object). Specifically:

class OnePassword(object):

    def __init__(self, secret=None, token=None, shorthand=None, bin_path=""):
        self.op = os.path.join(bin_path, "op")
        if secret is not None:
            self.shorthand = str(uuid4())
            self.session_token = self.get_access_token(secret, shorthand=self.shorthand)
        elif token is not None and shorthand is not None:
            self.shorthand = shorthand
            self.session_token = token
        else:
            raise MissingCredentials()

System Details
Windows 11 version 24H2
Python 3.12.8
1Password CLI 2.24.0
1Password 8.10.56

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions