Update Webtask Extension Settings / Secrets

Overview

This article provides steps to update the settings for a Webtask extension without reinstalling it. In certain scenarios, particularly with custom extensions, updating settings through the user interface (UI) is not possible and typically requires uninstalling and reinstalling the extension.

Applies To
  • Webtask Extension
Solution

The following example demonstrates updating the Custom Single Sign-On (SSO) Extension. 

  1. Capture a GET request for the Webtask extension by navigating to Dashboard > Extensions > Installed Extensions.

  2. Open the browser's Developer Tools, select the Network tab, and filter the requests by Fetch/XMLHttpRequest (XHR).
    Fetch/XHR 

  3. Next to the extension name, select the three dots (

    ...) and then select Settings.

  4. In the network tools, locate the new request that appears. Right-click the request and choose

    Copy > Copy as cURL.
    Copy as cURL 

  5. Paste the cURL command into a text editor.

  6. From the same network request, copy the response payload.
     

  7. Paste the response into the text editor.

  8. Modify the response JSON by removing the following key/value pairs:

    • container
    • name
    • token 
    • webtask_url
  9. Add a new url key/value pair to the JSON. To find this value, select Save in the settings pop-up and inspect the resulting PUT request in the network tools. For example:
    "url": "https://cdn.auth0.com/extensions/sso-dashboard/sso-dashboard-2.4.js"
  10. The final edited response should look similar to this structure:

{"meta":{"auth0-extension-version":"2.4.1","auth0-extension":"gallery","auth0-extension-name":"sso-dashboard"},"secrets":{"EXTENSION_SECRET":"123","EXTENSION_CLIENT_ID":"123","TITLE":"Your title","CUSTOM_CSS":"","AUTH0_CUSTOM_DOMAIN":"Your custom domain","PUBLIC_URL":"Your ublic url","FAVICON_URL":"","USER_GROUPS":"the comma-separated list of groups here","AUTH0_CLIENT_ID":"123","AUTH0_CLIENT_SECRET":"123","AUTH0_SCOPES":"read:clients delete:clients read:connections read:resource_servers create:resource_servers read:client_grants create:client_grants delete:client_grants","AUTH0_DOMAIN":"Your Domain","AUTH0_RTA":"https://auth0.auth0.com","AUTH0_MANAGE_URL":"https://manage.auth0.com","WT_URL":"https://us.webtask.run/api/run/domain/extensionname","PUBLIC_WT_URL":"https://your_domain.us.webtask.run/sso-dashboard","ISOLATED_DOMAIN":true}, "url":"https://raw.githubusercontent.com/danielbaker/auth0-sso-dashboard-extension/master/build/bundle.js"}
  1. Update the desired values, such as updating the USER_GROUPS with additional groups. 
  2. Convert the copied cURL command to a PUT request by adding the following two lines:
-X 'PUT' \
-H 'content-type: application/json' \
  1. Add the modified JSON payload to the cURL command between the -H 'x-csrftoken: line and the --compressed flag.
  2. The final cURL PUT request should have the following structure:

curl 'https://manage.auth0.com/api/webtask/your-tenant/extension-name' \
  -X 'PUT' \
  -H 'content-type: application/json' \
  -H 'authority: manage.auth0.com' \
  -H 'accept: application/json' \
  -H 'accept-language: en-GB,en-US;q=0.9,en;q=0.8' \
  -H 'authorization: Bearer undefined' \
  -H 'cache-control: no-cache' \
  -H 'cookie: !cookie value here!' \
  -H 'pragma: no-cache' \
  -H 'referer: https://manage.auth0.com/dashboard/us/your-tenant/extensions/installed' \
  -H 'sec-ch-ua: "useragent value here' \
  -H 'sec-ch-ua-mobile: ?0' \
  -H 'sec-ch-ua-platform: "your platform here"' \
  -H 'sec-fetch-dest: empty' \
  -H 'sec-fetch-mode: cors' \
  -H 'sec-fetch-site: same-origin' \
  -H 'user-agent: useragent here' \
  -H 'x-csrftoken: token here' \
  --data-raw '{"meta":{"auth0-extension-version":"2.4.1","auth0-extension":"gallery","auth0-extension-name":"sso-dashboard"},"secrets":{"EXTENSION_SECRET":"123","EXTENSION_CLIENT_ID":"123","TITLE":"Your title","CUSTOM_CSS":"","AUTH0_CUSTOM_DOMAIN":"Your custom domain","PUBLIC_URL":"Public url","FAVICON_URL":"","USER_GROUPS":"group1,group2,group3","AUTH0_CLIENT_ID":"123","AUTH0_CLIENT_SECRET":"123","AUTH0_SCOPES":"read:clients delete:clients read:connections read:resource_servers create:resource_servers read:client_grants create:client_grants delete:client_grants","AUTH0_DOMAIN":"Your Domain","AUTH0_RTA":"https://auth0.auth0.com","AUTH0_MANAGE_URL":"https://manage.auth0.com","WT_URL":"https://us.webtask.run/api/run/domain/extensionname","PUBLIC_WT_URL":"https://domain.us.webtask.run/sso-dashboard","ISOLATED_DOMAIN":true}, "url":"https://raw.githubusercontent.com/danielbaker/auth0-sso-dashboard-extension/master/build/bundle.js"}' \
  --compressed
  1. Copy the final cURL command, paste it into a terminal, and execute it to update the extension settings.

Recommended content

No recommended content found...