Token creation

There are two types of token in CDS:

Generate a sign-in token

You will be able to generate a new sign-in token for a builtin consumer with the web UI or the command line.

With the WEB UI

cds ui profile page

cds ui consumer creation

With CDS command line

To create a builtin consumer you should first be signed into CDS using local authentication for example.
$ cdsctl consumer new
? Name my-bot
? Description A bot consumer to import my templates
? Select groups availables for the new consumer my-group
? Select scopes availables for the new consumer Template
Builtin consumer successfully created, use the following token to sign in:
<signin-token-value>

Generate a session token

Sometimes if you want to call CDS through its APIs you will have to sign-in to obtain a session token like the following:

curl -X POST -d '{"token":"<signin-token-value>"}' http://my-cds/auth/consumer/builtin/signin

You will get a response that contains a session token, the session token is also set as a cookie in the response.

{
  "api_url":"http://my-cds",
  "token":"<session-token-value>",
  "user": {
    "id":"my-user-uuid",
    "created":"...",
    "username":"my-username",
    "fullname":"My Fullname",
    "ring":"USER"
  }
}