DS Server

Trial Token

Topic

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.
  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 and install it as the Installation Guide describes. Licensing Overview 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 URLhttps://trial.dsserver.io
Client IDThe client ID of your trial security profile
Client secretThe client secret of your trial security profile
Grant typeClient credentials
Validity30 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 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:

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:

{
  "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 uses the token in a first request, and POST /oauth/token 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.
LibraryService URLCredentials
DocumentProcessing (.NET)First argument of the DocumentProcessing constructornew OAuthSettings("<client ID>", "<client secret>")
Document Editor (ASP.NET Core)ServiceUrlOAuthSettings.ClientId and OAuthSettings.ClientSecret
Document Viewer (ASP.NET Core)BasePathOAuthSettings.ClientId and OAuthSettings.ClientSecret
Document Editor and Document Viewer (Angular)serviceURLoauthClientID and oauthClientSecret
Document Editor (React)serviceURLauthSettings={{ clientId, clientSecret }}
Document Viewer (React)serviceURLclientId and clientSecret
Document Editor (JavaScript)serviceURL of TXTextControl.init()authSettings: { clientId, clientSecret }
Document Viewer (JavaScript)The serviceURL constantThe clientId and clientSecret constants, sent as an HTTP Basic header to /oauth/token
Web API (any language)The host of every requestHTTP Basic header on POST /oauth/token

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

@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 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 shows, and replace the service URL and the credentials in your application. The code that calls DS Server stays the same.

Next Steps