Connect to Stardog Endpoint using Stardog CLI

Hi. I have a free Stardog cloud account and have difficulty connecting to the endpoint that is available to me. When I run the command below I receive an Authentication Failure error message. Since I do not have control/access to the endpoint, I do not know if authentication is based on a username & password or some other form. Currently, I am attempting to access the endpoint via my Stardog cloud account's username/password.

I put a placeholder for the server's endpoint address & user name; the password prompt appears when executing the command. The 'nw' is a reference to a Stardog database at the endpoint.

stardog --server query execute -u -P nw "SELECT * WHERE { ?s ?p ?o } LIMIT 10"

I would appreciate your feedback on resolving the authentication failure.

Hi Anthony

Although you're already signed in to Stardog Cloud in the browser, programmatic access works differently. The CLI (and PyStardog) authenticate with a username and password and they cannot reuse your browser SSO session. So create a dedicated API user on your endpoint.

Create an API User

  1. Open Studio IDE and select the Security icon in the left sidebar.
  2. Click + to create a new user.
  3. Enter a username and password, then click Add.

Your new user has no permissions yet. Stardog uses a default-deny RBAC model meaning access is denied unless explicitly granted. To give your API some privileges, assign it, for example, the built-in cloud role.

Assign the cloud Role

  1. In the Users panel, select your new user.
  2. Click Assign Role and select cloud.

Verify Access

You should now have your endpoint URL, username, and password. To confirm connectivity, open the following URL in your browser: {ENDPOINT}/catalog

eg https://sd-5eb9e7de.stardog.cloud:5820/catalog*
*
(This will access the nonamed graph of the catalog database.)

Sign in with your new API credentials when prompted. A successful response returns @prefix lines at the top this confirms your endpoint is reachable and your credentials are valid.

Joe

Hi, Joe. Much appreciated. Thank you.