Info: Migrating Applications from API Keys to OAuth Tokens

Info: Migrating Applications from API Keys to OAuth Tokens

141
Created On 11/10/26 11:03 AM - Last Modified 11/10/26 15:51 PM


Symptom


Applies to:

API Keys deprecated in Venafi Trust Protection Platform version 22.2

Summary:

  1. Identify where API keys are currently being used.
    • Find any custom code or scripted solutions that use API keys
    • Find users that are requesting API keys
      • Check the logs for events:
        1. WebSDK - Authorize Successful
        2. WebSDK - Authorize Failure
    • Find integrations that are requesting API keys
    • Check adaptable drivers
    • Check Venafi Software Extensions (VSE; standalone applications built by Venafi Professional Services for a customers environment)
  2. Convert your applications to use tokens.
    • Setup API Integrations
      • What scope(s) are required by the WebSDK calls?
      • What identities need access to the API integration?
    • Common calls and scopes required:
      • POST Certificates/Request
        1. Certificate:Manage
      • POST Config/Create
        1. Configuration:Manage
      • POST Config/ReadAll
        1. Configuration
    • Get token and store it securely
    • Track token life and refresh when needed
    • If getting new token with each run, revoke the token when done
    • Replace old X-Venafi-Api-Key header with new Authorization header in all applications/scripts.
      • Replace: @{X-Venafi-Api-Key= asdfas34-34h4-34nn-sa35-345hjkl43jh5l}
      • With: @{Authorization= Bearer 4MyGenerateBearerTknz==}
  3. Convert adaptable drivers to use tokens:
    • Each Adaptable Driver settings can be configured in the Policy Tree to include:
      • OAuth Application Id
      • OAuth Token Credential
      • OAuth Scope
    • When you configure Adaptable Driver settings with the OAuth information, the general hash table for the adaptable script will contain the appropriate URL and token.
      • .PARAMETER General
        1. WebSdkUrl: string representing the complete URL for the TPP WebSDK
        2. OAuthAccessToken: OAuth token string. Tokens are passed only after youve provided the required information in the WebSDK OAuth Token Configuration settings of the Adaptable object.
        3. Example: OAuthAccessToken: WXvTqxzFPo0iB47e6Y2YfQ==
  4. Convert Adaptable Scripts to use tokens
    • Update calls to WebSDK to use token instead of API key
      • Old header for authentication: @{X-Venafi-Api-Key= asdfas34-34h4-34nn-sa35-345hjkl43jh5l}
      • New header for authentication: @{Authorization= Bearer 4MyGenerateBearerTknz==}
  5. When "WebSDK - Authorize Successful" and "WebSDK - Authentication Failure" events no longer appear in the logs, then you are ready to upgrade to a version of TPP where the API keys are deprecated.

More Information:

https://docs.venafi.com/Docs/current/TopNav/Content/API-ApplicationIntegration/c-APIAppIntegrations-about.php

https://docs.venafi.com/Docs/current/TopNav/Content/SDK/AuthSDK/cco-sdka-REST-API-reference.php

https://docs.venafi.com/Docs/current/TopNav/Content/SDK/AuthSDK/t-SDKa-GetBearerToken.php



Environment


TPP/TLSPDC TLSPDC;SSH

Actions
  • Print
  • Copy Link

    https://knowledgebase.paloaltonetworks.com/KCSArticleDetail?id=kA1hj0000000n7LCAQ&lang=en_US&refURL=http%3A%2F%2Fknowledgebase.paloaltonetworks.com%2FKCSArticleDetail