Skip to content

Latest commit

 

History

History
94 lines (50 loc) · 4.18 KB

api-tokens.md

File metadata and controls

94 lines (50 loc) · 4.18 KB
description
Creating temporary and permanent API Tokens

API tokens

Introduction

DuploCloud supports two kinds of API tokens: temporary and permanent. For normal use cases, we recommend using a temporary API token. A permanent API token is warranted for CI/CD or other DevOps automation.

{% hint style="warning" %} Permanent API tokens will expire after one year. {% endhint %}

Temporary API tokens

Every time a user logs in to DuploCloud, a temporary API token is created for that user that only lasts for their session.

Getting a Temporary API token

Any user can retrieve their temporary API token from DuploCloud. Navigate to the User -> Profile page. Click the copy icon in the Temporary API Token area.

Profile page with Temporary API Token area

Permanent API tokens

Only administrators can create permanent API tokens. Permanent tokens are always associated with a specific Duplo user.

{% hint style="warning" %} Note: Permanent API tokens will expire after one year. {% endhint %}

Creating a Permanent API token

  1. In the DuploCloud Portal, navigate to Administrator -> Users.

  2. Click the Username in the list. The user's page displays. \

    Users page with Tokens tab

  3. Click the Tokens tab.

  4. Click Add. The Create a new token pane displays.\

    Create a new token pane
  5. Create a meaningful Token Name and click Create—a window containing the token displays.\

    Window with Token and Copy button

  6. Click the Copy button to copy your token to the clipboard. Store it somewhere safe. You cannot retrieve it from DuploCloud.

{% hint style="danger" %} Permanently save your token somewhere safe. You will not be able to retrieve it from DuploCloud after you have created it. However, if you lose your token, you can always create a new one. {% endhint %}

Configuring notifications for API tokens nearing expiration

You can configure DuploCloud system settings to generate faults and send notification emails when API tokens are nearing expiration.

Generating a fault when API tokens are near expiration:

  1. From the DuploCloud portal, navigate to Administrator -> Systems Settings. Select the Config tab, and click Add.
  2. For Config Type, select App Config; for Key, select Enable. For Token Notification, and in the Value field, enter the number of days before token expiration when faults should show.

Add Config pane configured to generate faults when API tokens will expire in 15 days.

  1. Click Submit. DuploCloud will generate a fault when an API token is the set number of days from expiration.

Sending automatic notifications when API tokens are near expiration:

  1. From the DuploCloud portal, navigate to Administrator -> Systems Settings. Select the Config tab, and click Add.

  2. For Config Type, select App Config; for Key, select User Token Expiration Notification Emails; and in the Value field, enter the user email addresses (separated by semicolons) to which notification emails will be sent. \

    Add Config pane configured to send a notification email when API tokens will expire in 15 days.

  3. Click Submit. DuploCloud will email the listed email address(es) when an API token is set to expire in a set number of days.