# Can't log in to Anaconda Cloud via CLI

**URL:** <https://forum.anaconda.com/t/cant-log-in-to-anaconda-cloud-via-cli/91641>\
**Category:** Cloud & Containers\
**Created:** [January 22, 2025, 6:08pm UTC](https://forum.anaconda.com/t/cant-log-in-to-anaconda-cloud-via-cli/91641 "2025-01-22T18:08:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aaron3](https://avatars.discourse-cdn.com/v4/letter/a/db6015/32.png) [@Aaron3](https://forum.anaconda.com/u/Aaron3)\
**Post date:** [January 22, 2025, 6:08pm UTC](https://forum.anaconda.com/t/cant-log-in-to-anaconda-cloud-via-cli/91641/1 "2025-01-22T18:08:37Z")

</div>

I was following the guide, [Environments — Anaconda documentation](https://docs.anaconda.com/psm-cloud/environments/), in an attempt to try out audit and env-log, but ran into issues while trying to login.

I tried `anaconda --verbose cloud login` and `anaconda login --at cloud`, but both commands hang indefinitely with no output. I discovered that they were trying to recover a token from, `redirect_uri: str = "http://127.0.0.1:8000/auth/oidc"`. However, I don’t think conda is hosting anything on that port, so I suppose it’s retrying indefinitely.

I also tried the basic login, but ran into this error:

```auto
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │ config = AnacondaCloudConfig( │ │
│ │ │ preferred_token_storage='anaconda-keyring', │ │
│ │ │ domain='anaconda.cloud', │ │
│ │ │ api_key=None, │ │
│ │ │ ssl_verify=True, │ │
│ │ │ extra_headers=None, │ │
│ │ │ client_id=' ************************************', │ │
│ │ │ redirect_uri='http://127.0.0.1:8000/auth/oidc', │ │
│ │ │ openid_config_path='api/auth/oauth2/.well-known/openid-configuration' │ │
│ │ ) │ │
│ │ password = ' ******************************' │ │
│ │ response = <Response [422]> │ │
│ │ response_data = { │ │
│ │ │ 'detail': [ │ │
│ │ │ │ { │ │
│ │ │ │ │ 'loc': ['body', 'grant_type'], │ │
│ │ │ │ │ 'msg': "unexpected value; permitted: 'authorization_code', │ │
│ │ 'refresh_token'", │ │
│ │ │ │ │ 'type': 'value_error.const', │ │
│ │ │ │ │ 'ctx': { │ │
│ │ │ │ │ │ 'given': 'password', │ │
│ │ │ │ │ │ 'permitted': ['authorization_code', 'refresh_token'] │ │
│ │ │ │ │ } │ │
│ │ │ │ } │ │
│ │ │ ] │ │
│ │ } │ │
│ │ username = ' ************' │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
│ │
│ conda/envs/org-base/lib/python3.12/site-packages/requests │
│ /models.py:1024 in raise_for_status │
│ │
│ 1021 │ │ │ ) │
│ 1022 │ │ │
│ 1023 │ │ if http_error_msg: │
│ ❱ 1024 │ │ │ raise HTTPError(http_error_msg, response=self) │
│ 1025 │ │
│ 1026 │ def close(self): │
│ 1027 │ │ """Releases the connection back to the pool. Once this method has been │
│ │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │ http_error_msg = '422 Client Error: Unprocessable Entity for url: │ │
│ │ https://auth.anaconda.cloud/api/'+17 │ │
│ │ reason = 'Unprocessable Entity' │ │
│ │ self = <Response [422]> │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
HTTPError: 422 Client Error: Unprocessable Entity for url: https://auth.anaconda.cloud/api/auth/oauth2/token

```

I believe I’m running the most up to date version:

```auto
$ conda --version
conda 25.1.0
$ python --version
Python 3.12.8
$ conda list | grep cloud
anaconda-activate-check 0.2.0 py_0 anaconda-cloud
anaconda-audit 0.3.3 py_0 anaconda-cloud
anaconda-cloud-auth 0.7.2 py312h06a4308_0  
anaconda-env-log 0.3.1 py_0 anaconda-cloud
anaconda-env-manager 0.1.2 0 anaconda-cloud

```

Are there any work arounds like changing the redirect url?
