Update Webtask Extension Settings / Secrets
Last Updated:
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.
-
Capture a GET request for the Webtask extension by navigating to Dashboard > Extensions > Installed Extensions.
-
Open the browser's Developer Tools, select the Network tab, and filter the requests by Fetch/XMLHttpRequest (XHR).
-
Next to the extension name, select the three dots (
...) and then select Settings.
-
In the network tools, locate the new request that appears. Right-click the request and choose
Copy > Copy as cURL.
-
Paste the cURL command into a text editor.
-
From the same network request, copy the response payload.
-
Paste the response into the text editor.
-
Modify the response JSON by removing the following key/value pairs:
containernametokenwebtask_url
- Add a new
urlkey/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"
- 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"}
- Update the desired values, such as updating the
USER_GROUPSwith additional groups. - Convert the copied cURL command to a PUT request by adding the following two lines:
-X 'PUT' \ -H 'content-type: application/json' \
- Add the modified JSON payload to the cURL command between the
-H 'x-csrftoken:line and the--compressedflag. -
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
- Copy the final cURL command, paste it into a terminal, and execute it to update the extension settings.