Skip to main content

Authenticate to Zitadel with miradi_auth-0.1.2 in conda env

Comments

1 comment

  • Official comment
    Miradi Tech Support

    Hi Diego,

    Yes, pipx is just one convenient way to install it. Its whole job is to keep the tool in its own isolated environment, which is why your script can't see it. miradi-auth is a normal pure-Python package (its only dependency is httpx), so you can install it straight into your conda environment instead:

    Using the same wheel you download from the Miradi Tools page on Miradi Share:

    conda activate <your-env-name>
    pip install /path/to/miradi_auth-0.1.2-py3-none-any.whl   # wherever you saved the download

    After that, both the miradi-auth command and the importable package live in your conda environment. And you can skip the subprocess approach entirely, it's designed to be called directly from Python:

    from miradi_auth import get_token
    token = get_token(env="live") # refreshes automatically as needed


    You still do the one-time interactive sign-in once from a terminal (with the env active) to create the stored session:

    miradi-auth login --env live

    From then on, get_token(env="live") reads and silently refreshes that stored token in-process.

    -Brian

Please sign in to leave a comment.