# Trial Token

> Request a 30-day trial token for trial.dsserver.io, get an access token with client credentials and point the Getting Started samples at the trial server.

- **Product:** DS Server
- **Section:** Documentation
- **Kind:** Topic
- **Path:** DS Server > Getting Started > Trial Token
- **1784 words**
- **Web URL:** https://docs.textcontrol.com/ds-server/getting-started/trial-token/
- **LLMs URL:** https://docs.textcontrol.com/ds-server/getting-started/trial-token/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/ds-server/getting-started/trial-token/llms-full.txt

---

A trial token lets you try DS Server before you install anything. Text Control runs a DS Server at `https://trial.dsserver.io`, and the token gives you the credentials of a security profile on it, so you can send your first requests and build the Getting Started applications against a working server within minutes.

Read on for how to request a token, what it contains, and what changes in the samples of the other Getting Started pages when you use it instead of a server of your own.

### Request a Trial Token

1. Open [dsserver.io/trial](https://www.dsserver.io/trial/).
2. Enter your email address, agree to the processing of your personal data as the privacy policy describes, and type in the captcha.
3. Click **Request trial token**.

The token is valid for 30 days and is meant for evaluation. To test DS Server on your own machine instead, download the trial version from the [DS Server download page](https://www.textcontrol.com/product/ds-server/download/) and install it as the [Installation Guide](https://docs.textcontrol.com/ds-server/installation/llms-full.txt) describes. [Licensing Overview](https://docs.textcontrol.com/ds-server/overview/licensing/#trial-token-and-trial-version) compares the two options.

### What You Get

A trial token is not a single token but the credentials of a security profile, the set of OAuth credentials that DS Server issues access tokens for:

|  | Value |
|---|---|
| Service URL | `https://trial.dsserver.io` |
| Client ID | The client ID of your trial security profile |
| Client secret | The client secret of your trial security profile |
| Grant type | Client credentials |
| Validity | 30 days |

Keep the client ID and the client secret to yourself: anyone who has them can send requests on your behalf until the trial ends.

The trial server behaves like a DS Server of your own with OAuth enabled. It answers every Web API request without a valid access token with `401 Unauthorized`, and its admin portal is not open to you, so you can't create security profiles or change settings on it. A server you install yourself starts with OAuth disabled; [Enable OAuth](https://docs.textcontrol.com/ds-server/administration/oauth/llms-full.txt) explains the switch.

### How the Trial Token Authorizes Requests

DS Server uses OAuth to authorize requests. An application exchanges the credentials of a security profile for an access token at the `/oauth/token` endpoint and sends the access token with every request. For the trial profile, the *client credentials* grant type is enabled: your application sends the client ID and the client secret and receives an access token directly, without redirecting a user through an authorization step.

With curl, the token request looks like this. The client ID and the client secret go in an HTTP Basic `Authorization` header:

```bash
curl --request POST 'https://trial.dsserver.io/oauth/token' \
    --user '<client ID>:<client secret>' \
    --data-urlencode grant_type=client_credentials
```

The response contains the access token, and `expires_in` gives its lifetime in seconds:

```json
{
  "access_token": "<access token>",
  "token_type": "Bearer",
  "expires_in": "3600"
}
```

The client libraries send this request for you when you give them the client ID and the client secret. [Web API](https://docs.textcontrol.com/ds-server/getting-started/document-processing/web-api/llms-full.txt) uses the token in a first request, and [POST /oauth/token](https://docs.textcontrol.com/ds-server/reference/web-api/oauth/token/post/llms-full.txt) describes the endpoint.

### Use the Trial Token in the Samples

The Getting Started samples are written for a DS Server of your own. With a trial token, you change two things in each of them:

- **Set the service URL to `https://trial.dsserver.io`.** Replace the address of your own server, such as `http://localhost:5000`, wherever a sample sets it.
- **Leave out the redirect URI** where a sample sets one. Without a redirect URI, the client libraries use the client credentials grant type, which the trial profile allows. The steps that register a redirect URI or create a security profile in the admin portal don't apply.

| Library | Service URL | Credentials |
|---|---|---|
| DocumentProcessing (.NET) | First argument of the `DocumentProcessing` constructor | `new OAuthSettings("<client ID>", "<client secret>")` |
| Document Editor (ASP.NET Core) | `ServiceUrl` | `OAuthSettings.ClientId` and `OAuthSettings.ClientSecret` |
| Document Viewer (ASP.NET Core) | `BasePath` | `OAuthSettings.ClientId` and `OAuthSettings.ClientSecret` |
| Document Editor and Document Viewer (Angular) | `serviceURL` | `oauthClientID` and `oauthClientSecret` |
| Document Editor (React) | `serviceURL` | `authSettings={{ clientId, clientSecret }}` |
| Document Viewer (React) | `serviceURL` | `clientId` and `clientSecret` |
| Document Editor (JavaScript) | `serviceURL` of `TXTextControl.init()` | `authSettings: { clientId, clientSecret }` |
| Document Viewer (JavaScript) | The `serviceURL` constant | The `clientId` and `clientSecret` constants, sent as an HTTP Basic header to `/oauth/token` |
| Web API (any language) | The host of every request | HTTP Basic header on `POST /oauth/token` |

For example, a Document Editor in an ASP.NET Core view that connects to the trial server:

```cshtml
@using TXTextControl.DocumentServices.DocumentEditor

@Html.TXTextControl().DocumentEditor(settings => {
    settings.Width = "1000px";
    settings.Height = "600px";
    settings.ServiceUrl = "https://trial.dsserver.io";
    settings.OAuthSettings.ClientId = "<client ID>";
    settings.OAuthSettings.ClientSecret = "<client secret>";
}).Render()
```

In a Razor view, the client secret stays on your server. In the Angular, React and JavaScript samples, the client ID and the client secret are part of the code that the browser downloads, which is acceptable for an evaluation but not for production. [Overview](https://docs.textcontrol.com/ds-server/client-libraries/overview/#authorize-a-library) of the client libraries explains how a production application requests the access token on the server instead.

### When the Trial Ends

The trial credentials stop working when the 30 days are over. To continue, install DS Server on a machine of your own, create a security profile for each application as [Creating Security Profiles](https://docs.textcontrol.com/ds-server/administration/security-profiles/llms-full.txt) shows, and replace the service URL and the credentials in your application. The code that calls DS Server stays the same.

### Next Steps

- [Document Processing](https://docs.textcontrol.com/ds-server/getting-started/document-processing/llms-full.txt): convert a document to PDF with the .NET package or with plain HTTP requests.
- [Document Editor](https://docs.textcontrol.com/ds-server/getting-started/document-editor/llms-full.txt): add the word processor to an ASP.NET Core, Angular, React or JavaScript application.
- [Document Viewer](https://docs.textcontrol.com/ds-server/getting-started/document-viewer/llms-full.txt): display documents in the browser.
- [Getting Started](https://docs.textcontrol.com/ds-server/getting-started/llms-full.txt): the overview of the first applications.

---

## Nearby

- **Previous:** [Getting Started](https://docs.textcontrol.com/ds-server/getting-started/llms-full.txt)
- **Next:** [Document Processing](https://docs.textcontrol.com/ds-server/getting-started/document-processing/llms-full.txt)
