# Error 401 when trying to connect stardog cloud (free)

**URL:** https://community.stardog.com/t/error-401-when-trying-to-connect-stardog-cloud-free/4863
**Category:** Bug
**Created:** [March 4, 2024, 3:48pm UTC](https://community.stardog.com/t/error-401-when-trying-to-connect-stardog-cloud-free/4863 "2024-03-04T15:48:10Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Dmunnoz](https://avatars.discourse-cdn.com/v4/letter/d/b2d939/32.png) [@Dmunnoz](https://community.stardog.com/u/Dmunnoz)
#### Post date: [March 4, 2024, 3:48pm UTC](https://community.stardog.com/t/error-401-when-trying-to-connect-stardog-cloud-free/4863/1 "2024-03-04T15:48:10Z")

</div>

```auto
import stardog
from pathlib import Path

# specify our endpoint, username, and password
# default values are provided, be sure to change if necessary
conn_details = {
    'endpoint': 'https://sd-<XXX>106.stardog.cloud:5820',
    'username': '<MAIL>',
    'password': '<SSO PASS>'
}

with stardog.Admin(**conn_details) as admin:
  db = admin.new_database('db')

  with stardog.Connection('db', **conn_details) as conn:
    conn.begin()
    conn.add(stardog.content.File('sample.ttl'))
    conn.commit()
    results = conn.select('select * { ?a ?p ?o }')

  db.drop()

```

Return\>

```auto
Traceback (most recent call last):
  File "/home/kali/Desktop/Stardog/python-client/create_db.py", line 12, in <module>
    with stardog.Admin(**conn_details) as admin:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/kali/Desktop/Stardog/python-client/env/lib/python3.11/site-packages/stardog/admin.py", line 53, in __init__
    self.alive()
  File "/home/kali/Desktop/Stardog/python-client/env/lib/python3.11/site-packages/stardog/admin.py", line 65, in alive
    r = self.client.get("/admin/alive")
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/kali/Desktop/Stardog/python-client/env/lib/python3.11/site-packages/stardog/http/client.py", line 59, in get
    return self.__wrap(self.session.get(self.url + path, **kwargs))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/kali/Desktop/Stardog/python-client/env/lib/python3.11/site-packages/stardog/http/client.py", line 75, in __wrap
    raise exceptions.StardogException(
stardog.exceptions.StardogException: [401] : 

```

The endpoint and the credentials are correct.

---

<div class="post-metadata">

### Author: ![Lars\_Heling](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/lars_heling/32/1657_2.png) [@Lars\_Heling](https://community.stardog.com/u/Lars_Heling)
#### Post date: [March 6, 2024, 6:28am UTC](https://community.stardog.com/t/error-401-when-trying-to-connect-stardog-cloud-free/4863/2 "2024-03-06T06:28:13Z")

</div>

Hi,

I think instead of using your SSO password, you need to use the password specific to your endpoint. You can set this password by going into Studio, go to the Security tab and select your user. Select the menu in the upper right corner and select "Change Password". This should allow you to set a password for your user on this endpoint.  
 ![Screenshot 2024-03-06 at 07.25.45](https://canada1.discourse-cdn.com/flex030/uploads/stardog/original/2X/5/5d11a5214a6a602f0e7cf9334a5a13c1dd9896d9.png)

You can then use the password to connect to our endpoint in your python script.

Best regards,

Lars

---

<div class="post-metadata">

### Author: ![Dmunnoz](https://avatars.discourse-cdn.com/v4/letter/d/b2d939/32.png) [@Dmunnoz](https://community.stardog.com/u/Dmunnoz)
#### Post date: [March 6, 2024, 10:11am UTC](https://community.stardog.com/t/error-401-when-trying-to-connect-stardog-cloud-free/4863/3 "2024-03-06T10:11:31Z")

</div>

Hi Lars, thank you for your response. After making the changes, everything is working correctly. Thank you.

---

<div class="post-metadata">

### Author: ![akshaykadidal](https://avatars.discourse-cdn.com/v4/letter/a/7ea924/32.png) [@akshaykadidal](https://community.stardog.com/u/akshaykadidal)
#### Post date: [February 21, 2026, 1:12am UTC](https://community.stardog.com/t/error-401-when-trying-to-connect-stardog-cloud-free/4863/4 "2026-02-21T01:12:54Z")

</div>

I don’t see this option while using stardog free

---

<div class="post-metadata">

### Author: ![PaulPlace](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/paulplace/32/1447_2.png) [@PaulPlace](https://community.stardog.com/u/PaulPlace)
#### Post date: [February 21, 2026, 1:41am UTC](https://community.stardog.com/t/error-401-when-trying-to-connect-stardog-cloud-free/4863/5 "2026-02-21T01:41:42Z")

</div>

Hello Akshay,

What is it that you are trying to do? If you want to access your Stardog Cloud Free endpoint through the API, then you need to create a username and password for programmatic access. See [Accessing API Endpoint | Stardog Documentation Latest](https://docs.stardog.com/stardog-cloud/accessing-api-endpoint#best-practices-for-api-access-users) for more details. In order to create an API user and/or change the user’s password, the easiest approach is to use Stardog Studio.

Regards,

Paul Place

---

<div class="post-metadata">

### Author: ![akshaykadidal](https://avatars.discourse-cdn.com/v4/letter/a/7ea924/32.png) [@akshaykadidal](https://community.stardog.com/u/akshaykadidal)
#### Post date: [February 21, 2026, 2:48am UTC](https://community.stardog.com/t/error-401-when-trying-to-connect-stardog-cloud-free/4863/6 "2026-02-21T02:48:27Z")

</div>

Hi Paul,

Appreciate your quick response. I was trying to connect to the endpoint using the pystardog python package. I was trying to connect using my details on the portal.

I managed to connect once I updated the password in studio.

Thank you,

AK

---

<div class="post-metadata">

### Author: ![PaulPlace](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/paulplace/32/1447_2.png) [@PaulPlace](https://community.stardog.com/u/PaulPlace)
#### Post date: [February 21, 2026, 10:21pm UTC](https://community.stardog.com/t/error-401-when-trying-to-connect-stardog-cloud-free/4863/7 "2026-02-21T22:21:29Z")

</div>


