Skip to main content Link Search Menu Expand Document (external link)

Using Personal Access Tokens

Use cases involving the automatization of the interaction with the NAPPTIVE Playground such as CI integrations, or executions triggered by scripts are not possible with OAuth authentication mechanisms as there is no possibility to open a window browser, nor is there a user that can answer the OAuth challenge.

Personal Access Tokens (PAT) represent an alternative method to authenticate against the NAPPTIVE Playground using a programmatic approach with HTTP requests. A user account can have several PAT associated to it.


  • Playground tools are installed (kubectl & playground)
  • A valid NAPPTIVE Playground account
playground login
Login success

Creating a Personal Access Token (PAT)

To generate a new token you can use the CLI with the following command:

playground user pat create ci_pat
ci_pat    <your token>

Please store this value safely as it cannot be retrieved once generated. To login with this value, set the environment variable PLAYGROUND_PAT with the token, or save it to a file. Use 'playground login --pat' to log into the NAPPTIVE Playground without OAuth.

Alternatively, you can store the contents of the generated pat with:

playground user pat create test_pat --patFile /tmp/test_pat.dat
You can use this Personal Access Token to log into the NAPPTIVE Playground using the following command:

$ playground login --patFile /tmp/test_pat.dat

Using the Personal Access Token (PAT)

There are two methods to use PAT. First, you can set the environment variable PLAYGROUND_PAT with the contents of the token, and execute:

playground login --pat
Login success

Alternatively, you can load the PAT from a file using:

playground login --patFile /tmp/test_pat.dat
Login success

After this, you can interact normally with the NAPPTIVE Playground using the playground CLI.

Listing Personal Access Tokens (PAT)

To list the tokens associated with your user account and check when they were last used, execute:

playground user pat list
ci_pat      2021-04-06 18:16:28 +0200 CEST
test_pat    2021-04-06 18:18:19 +0200 CEST

Removing/Revoking a Personal Access Token (PAT)

To remove/revoke a Personal Access Token use:

playground user pat delete mypat
SUCCESS    Removed

Note that this operation removes the token from the system. Sessions that have already been negotiated using this token will not be invalidated.


Invalid character U looking for beginning value

$ playground login --pat
invalid character 'U' looking for beginning of value

This is usually related with the value of PLAYGROUND_PAT a likely cause by the terminal copy & paste settings. Make sure no trailing newline characters (\n) are included at the end.

What’s next

  • Check our tutorials on how to deploy predefined applications
  • Clone our cd-example repository and discover how you can integrate a QA pipeline with the NAPPTIVE Playground.