---
title: "Authentication (TigerGraph 3.x)"
description: "How authentication works in TigerGraph REST API."
component: "tigergraph-server"
version: "4.3"
module: "API"
html_url: "/tigergraph-server/4.3/API/authentication"
canonical_url: "https://www.tigergraph.com/docs/tigergraph-server/4.3/API/authentication"
markdown_url: "https://www.tigergraph.com/docs/tigergraph-server/4.3/API/authentication.md"
---

[View as HTML](https://www.tigergraph.com/docs/tigergraph-server/4.3/API/authentication)

# Authentication (TigerGraph 3.x)

TigerGraph's RESTful APIs communicate with either the REST++ server on port 9000 or the GSQL server on port 14240\. Each server uses different methods of authentication.

> [!NOTE]
> * This page applies only to TigerGraph 3.x.
> * As of 3.10.0, the use of plaintext tokens in authentication is deprecated. In TigerGraph 4.1, authentication uses [JWT tokens](https://www.tigergraph.com/docs/tigergraph-server/4.3/user-access/jwt-token.md) and access port is 14240 for self-managed installations.
> * For TigerGraph Cloud, use port 443.

## REST++ Server Requests

TigerGraph REST++ endpoints are public by default: anyone with access to the HTTP ports of the TigerGraph server can run your endpoints. When [REST++ authentication is enabled](https://www.tigergraph.com/docs/tigergraph-server/4.3/user-access/enabling-user-authentication.md), then a valid authorization token must be included in the header.

The REST++ server implements OAuth 2.0-style authorization as follows:

1. Each user [can create one or more **secrets** (unique pseudorandom strings)](https://www.tigergraph.com/docs/tigergraph-server/4.3/user-access/user-credentials.md#_create_a_secret). Each secret is associated with a particular user and the user's privileges for a particular graph.
2. Anyone who has this secret can invoke a special REST endpoint to [generate authorization **tokens**](https://www.tigergraph.com/docs/tigergraph-server/4.3/API/built-in-endpoints.md#_request_a_token) (other pseudorandom strings).
3. An authorization token can then be used to perform TigerGraph database operations via other REST endpoints. Each token will expire after a certain period of time. The TigerGraph default lifetime for a token is 1 month.

### **Using Tokens**

Once REST++ authentication is enabled, a valid token should always be included in the HTTP header. If you are using curl to format and submit your REST++ requests, then use the following syntax:

curl GSQL request, with authorization token in header

```console
curl -X GET -H "Authorization: Bearer <token>" '<request_URL>'
```

Here is a sample request:

```console
curl -X GET -H "Authorization: Bearer 01234567abcdefgh01234567abcdefgh" "http://localhost:14240/restpp/graph/socialNet/vertices/User?limit=3"
```

### 3rd party JWT token

Since 3.10.0, TigerGraph now supports the use of 3rd party JWT token. See [OIDC JWT Authentication](https://www.tigergraph.com/docs/tigergraph-server/4.3/user-access/jwt-token.md) for more details.

## GSQL Server Requests

All requests made to the GSQL Server must be accompanied by your user credentials. You can use the `curl -u` option to pass in the username and password of the TigerGraph user:

```console
curl -X GET -u <username>:<password> "http://localhost:14240/<path_to_endpoint>
```

To keep your credentials more secure, one way to avoid having the user name and password on the command line is to instead use a [.netrc file](https://everything.curl.dev/usingcurl/netrc) or a [config file](https://everything.curl.dev/cmdline/configfile). If you are in interactive mode, you can also use the `-u` option without specifying the password, and then curl will prompt for the password.
