> ## Documentation Index
> Fetch the complete documentation index at: https://docs.opigno.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Access Token Management

> Learn how to create, manage, and revoke access tokens for secure API integrations with Opigno Enterprise

## Overview

Access tokens are the foundation of secure API authentication in Opigno Enterprise. The Access Token Management interface allows administrators to create, monitor, and control API access for external integrations like Zapier.

<Info>
  Each access token is bound to a specific learning area and provides OAuth2-based authentication for API operations within that scope.
</Info>

## Accessing Token Management

To manage access tokens in your Opigno Enterprise instance:

<Steps>
  <Step title="Navigate to Authentication Settings">
    1. Log into your Opigno Enterprise backoffice as an administrator
    2. Locate the **Configuration** section in the left sidebar
    3. Click on **Authentication**
    4. Select **Manage access tokens**
  </Step>

  <Step title="View Existing Tokens">
    You'll see a table displaying all existing access tokens with the following information:

    * Token name
    * Client ID
    * Expiration date
    * Available actions (revoke, edit)
  </Step>
</Steps>

<Warning>
  Only users with administrator privileges can access and manage access tokens. Ensure your account has the necessary permissions before proceeding.
</Warning>

## Understanding the Token List

The Access Tokens page displays all active and expired tokens in your system. For each token, you can view:

### Token Information Displayed

<ResponseField name="Token Name" type="string">
  The descriptive label assigned to this token for easy identification.
</ResponseField>

<ResponseField name="Client ID" type="string">
  The unique OAuth2 client identifier used for authentication requests.
</ResponseField>

<ResponseField name="Expiration Date" type="date">
  The date when this token will expire and can no longer be used for API access.
</ResponseField>

<ResponseField name="Actions" type="buttons">
  Available operations for this token, including:

  * **Revoke**: Immediately invalidate the token
  * **Edit**: Modify token settings (name, expiration)
</ResponseField>

<Frame caption="Access tokens management interface showing the list of existing tokens">
  <img src="https://mintcdn.com/connect-i/Jn0jyPIz_WONQ3IP/images/screencapture-zapier-auth-token.png?fit=max&auto=format&n=Jn0jyPIz_WONQ3IP&q=85&s=0665581a2a3b703e90e7385dd1fd62a8" alt="Screenshot of the access tokens page displaying token list with names, client IDs, and expiration dates" width="1258" height="1297" data-path="images/screencapture-zapier-auth-token.png" />
</Frame>

## Creating a New Access Token

To add a new access token for API integrations:

<Steps>
  <Step title="Initiate Token Creation">
    Click the **Add access token** button at the top of the Access Tokens page.
  </Step>

  <Step title="Configure Token Settings">
    A modal dialog will appear with the following configuration fields:

    ### Learning Area Selection

    <ParamField body="learning_area" type="dropdown" required>
      Select the learning area this token will be restricted to. The token will only have access to users, trainings, and data within this specific learning area.

      <Tip>
        Create separate tokens for each learning area you need to integrate. This provides better security and access control.
      </Tip>
    </ParamField>

    ### Token Name

    <ParamField body="token_name" type="string" required>
      Enter a descriptive name to identify the token's purpose. Use clear, meaningful names like:

      * "Zapier Integration - Sales Department"
      * "HR Management System API"
      * "Marketing Automation - Training Sync"

      <Info>
        Good naming conventions help you manage multiple tokens effectively, especially when you need to revoke or update them later.
      </Info>
    </ParamField>

    ### Expiration Period

    <ParamField body="expiration_date" type="date" default="1 year from creation">
      Set when the token should expire. The default is one year from the creation date.

      <Warning>
        Choose an appropriate expiration period based on your organization's security policies. Shorter periods are more secure but require more frequent token rotation.
      </Warning>
    </ParamField>

    ### OAuth2 Credentials

    <ParamField body="client_id" type="string" auto-generated>
      The system automatically generates a unique Client ID when you create the token. This identifier is used in API authentication requests.
    </ParamField>

    <ParamField body="client_secret" type="string" auto-generated>
      The system generates a secure secret key for this token. This value is shown only once during creation.

      <Warning>
        **Critical Security Information:**

        * The client secret is displayed only once after creation
        * Copy and store it immediately in a secure location
        * Never share it publicly or commit it to version control
        * If lost, you must generate a new token
        * The secret is stored as a hash and cannot be retrieved later
      </Warning>
    </ParamField>
  </Step>

  <Step title="Generate and Save Credentials">
    1. Review all the configuration settings
    2. Click **Submit** to generate the token
    3. **Immediately copy the Client ID and Client Secret**
    4. Store them securely (password manager, secure vault, etc.)
    5. The new token will appear in the tokens list

    <Check>
      After submission, verify that your new token appears in the list with the correct name and expiration date.
    </Check>
  </Step>
</Steps>

## Token Security Best Practices

<AccordionGroup>
  <Accordion title="Secure Storage">
    **Always store credentials securely:**

    * Use environment variables for production systems
    * Store in a password manager or secrets vault
    * Never hardcode in application source code
    * Keep separate tokens for development and production

    **Example secure storage:**

    ```bash .env theme={null}
    OPIGNO_CLIENT_ID=your_client_id_here
    OPIGNO_CLIENT_SECRET=your_client_secret_here
    OPIGNO_BASE_URL=https://yourcompany.opigno.cloud
    ```
  </Accordion>

  <Accordion title="Access Control">
    **Limit token access appropriately:**

    * Create separate tokens for each integration
    * Assign tokens to specific learning areas only
    * Use descriptive names to track usage
    * Regularly audit active tokens

    **Example naming strategy:**

    * Production: `Zapier Prod - Sales Team`
    * Staging: `Zapier Staging - Sales Team`
    * Development: `Zapier Dev - Testing`
  </Accordion>

  <Accordion title="Rotation and Expiration">
    **Implement token rotation policies:**

    * Set appropriate expiration dates
    * Plan token renewal before expiration
    * Revoke unused or old tokens
    * Update integrations with new credentials promptly

    **Recommended expiration periods:**

    * Production environments: 6-12 months
    * Development/testing: 3-6 months
    * Temporary integrations: 1-3 months
  </Accordion>

  <Accordion title="Monitoring and Auditing">
    **Track token usage:**

    * Regularly review the tokens list
    * Monitor expiration dates
    * Remove tokens for decommissioned integrations
    * Document which systems use which tokens

    <Tip>
      Set calendar reminders to review tokens quarterly and renew those approaching expiration.
    </Tip>
  </Accordion>
</AccordionGroup>

## Managing Existing Tokens

### Revoking a Token

If you need to immediately disable a token:

<Steps>
  <Step title="Locate the Token">
    Find the token you want to revoke in the tokens list.
  </Step>

  <Step title="Revoke Access">
    1. Click the **Revoke** action button for that token
    2. Confirm the revocation when prompted
    3. The token is immediately invalidated

    <Warning>
      Revocation is immediate and cannot be undone. Any systems using this token will lose API access immediately.
    </Warning>
  </Step>

  <Step title="Update Integration">
    If the token was actively used, update your integration with a new token to restore functionality.
  </Step>
</Steps>

### When to Revoke Tokens

You should revoke tokens when:

* The token has been compromised or exposed
* The integration is no longer needed
* An employee with access has left the organization
* You're replacing it with a new token
* The learning area assignment needs to change

## Troubleshooting

<AccordionGroup>
  <Accordion title="Cannot Create New Token">
    **Possible causes:**

    * Insufficient administrator permissions
    * No learning areas available in the system
    * System configuration issues

    **Solutions:**

    1. Verify you're logged in as an administrator
    2. Check that at least one learning area exists
    3. Contact your system administrator if issues persist
  </Accordion>

  <Accordion title="Lost Client Secret">
    **Problem:** The client secret was not saved during token creation.

    **Solution:**
    The secret cannot be retrieved after the creation dialog closes. You must:

    1. Revoke the existing token
    2. Create a new token
    3. Immediately copy and securely store the new credentials
  </Accordion>

  <Accordion title="Token Expired">
    **Problem:** API requests fail with authentication errors.

    **Solution:**

    1. Check the expiration date in the tokens list
    2. Create a new token with the same learning area
    3. Update your integration with the new credentials
    4. Revoke the old expired token
  </Accordion>

  <Accordion title="Wrong Learning Area Assigned">
    **Problem:** Token doesn't have access to needed resources.

    **Solution:**
    Learning area assignments cannot be changed after creation. You must:

    1. Create a new token with the correct learning area
    2. Update your integration to use the new token
    3. Revoke the old token

    <Info>
      This security design ensures clear audit trails and prevents accidental privilege escalation.
    </Info>
  </Accordion>
</AccordionGroup>

## Next Steps

Ready to proceed? Start here:

<CardGroup cols={2}>
  <Card title="Using Tokens with Zapier" icon="plug" href="/zapier-integration/using-tokens-with-zapier">
    Step-by-step guide to configuring your access tokens in Zapier.
  </Card>

  <Card title="Authentication Setup" icon="key" href="/zapier-integration/authentication">
    Complete guide to configuring Zapier authentication with your access tokens.
  </Card>
</CardGroup>
