Help using secure setting placeholder {{setting.name}}
AnsweredI am currently creating an app for support and I am having trouble using the secure placeholder {{setting.name}}.
I am following this article: https://developer.zendesk.com/documentation/apps/app-developer-guide/using-the-apps-framework/?_ga=2.194966061.1010806308.1659961382-218685136.1659626457#using-secure-settings
I have installed the app as a private app since I know it does not work with the developer environment.
My request settings are setup as such:
-
Hey Mathew,
Quick review of your code and it looks good. Can you tell us more about the troubles that you're having? Is the auth header undefined or something else when received at the requests url?
Thanks!
-
I received 401 and 403 errors from the request when the app was installed and using the placeholder. When the basic authentication is hard coded the app functions as normal. When checking the Authorization header in the console, it looks as if it is sending "{{setting.name:PAT}}" as the credentials without swapping out the placeholder resulting in the errors. I am just not sure what to change to fix it.
-
It looks like the base64 encoding is happening prior to the proxy replacing the placeholder with the secure value. An easy option to fix this would be to just save the string already base64 encoded into the secure setting field. That way the encoding isn't happening prior to the request hitting the proxy.
-
Unfortunately that didn't seem to work. The auth header came out as "Authorization: "Basic {{setting.token}}". String was already encoded as well and updated within the apps settings.
-
Hey Matthew,
Sorry that I missed your response. Are you still having issues?
-
Yeah. The possible solutions haven't worked. Are there any small details I could be missing?
-
Hey Matthew,
Tough to say, I just spun up a small example repo which you can use as a point of reference / to test out the workflow.
Hope this helps!
-
That's amazing. I'll take a look and update if I have any questions. Thank you!
-
Seems I found the issue. The domainWhiteList property was what was giving issues. Seems I may not have the correct domain in the setting.
Please sign in to leave a comment.
9 Comments