4.2.4 Connect to the Server from JShell with Database Authentication

You can use the JShell client to connect to the server in remote mode, using database authentication.

To connect to the server in remote mode:
./bin/opg4j --base_url https://localhost:7007 --username <database_user>

You will be prompted for the database password.

If you are using a Java client program, you can connect to the server as shown in the following example:
import oracle.pg.rdbms.*
import oracle.pgx.api.*
 
...
 
ServerInstance instance = GraphServer.getInstance("https://localhost:7007", "<database user>", "<database password>");
PgxSession session = instance.createSession("my-session");

...

Internally, users are authenticated with the graph server using JSON Web Tokens (JWT). See Token Expiration for more details about token expiration.