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:
- 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:
- WebSDK - Authorize Successful
- WebSDK - Authorize Failure
- Check the logs for events:
- 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)
- 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
- Certificate:Manage
- POST Config/Create
- Configuration:Manage
- POST Config/ReadAll
- Configuration
- POST Certificates/Request
- 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==}
- Setup API Integrations
- 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
- WebSdkUrl: string representing the complete URL for the TPP WebSDK
- 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.
- Example: OAuthAccessToken: WXvTqxzFPo0iB47e6Y2YfQ==
- .PARAMETER General
- Each Adaptable Driver settings can be configured in the Policy Tree to include:
- 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==}
- Update calls to WebSDK to use token instead of API key
- 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/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