The purpose of this example configuration is to demonstrate how to deploy and configure Launchpad for a Stardog instance to allow users to sign in with a Stardog username and password.
The way this configuration works is a user provides their Stardog username and password to the login dialog. The application validates the user’s provided credentials and attempts to fetch a JWT from Stardog. This JWT from Stardog is then used for all subsequent calls against the Stardog server. For example, when a user is authenticated and then decides to open Stardog Studio, the JWT will be used for all authenticated calls against the Stardog server (e.g. listing all databases in the Stardog server, running a query, etc).
-
Docker installed
-
Docker Compose installed
-
A Stardog server running locally on port
5820
.Note: If you have a Stardog server running elsewhere (locally or not), this is fine, just modify the
STARDOG_INTERNAL_ENDPOINT
andSTARDOG_EXTERNAL_ENDPOINT
in the.env
file as needed.
-
Stardog server must be v7.8 or above
-
The following setting should be set in the Stardog’s server’s
stardog.properties
you want to authenticate against.jwt.disable=false
Note: By default this property is set to
false
, so you can likely omit this.
-
Execute the following command from this directory to bring up the Launchpad service.
docker-compose up -d
-
Visit http://localhost:8080 in your browser.
In the example:
-
The image is being run and used locally for demo purposes.
BASE_URL
is set tohttp://localhost:8080
. As a result,SECURE
is set tofalse
since theBASE_URL
is a non-https URL. The login service assumeshttps
and will not work properly without this flag being set to false. Port8080
is used in theBASE_URL
because it is mapped to the container's port8080
in theports
section of thedocker-compose.yml
. If the container's port8080
was mapped to port9000
on the Docker host,BASE_URL
would be set equal tohttp://localhost:9000
-
STARDOG_EXTERNAL_ENDPOINT
is set tohttp://localhost:5820
. This is the address your browser will make Stardog API requests to. -
STARDOG_INTERNAL_ENDPOINT
is set tohttp://host.docker.internal:5820
. This is the address the Launchpad container will make Stardog API requests to. This is required in this case in order for the Docker container to distinguish between what's running on the Docker host and the container itself. See the Docker documentation for additional information.Note: If you have a Stardog server running remotely, set the
STARDOG_INTERNAL_ENDPOINT
to the same value asSTARDOG_EXTERNAL_ENDPOINT
in the.env
file. -
COOKIE_SECRET
is set tosome-secret
. In production, this should actually be set to something secure and much more random. This secret is used to sign cookies used by the application. -
FRIENDLY_NAME
is set toStardog Applications
. This is just optional text to display to the user on the login dialog. This text will be inserted afterConnect to
.