Help using secure setting placeholder {{setting.name}}
Respondido
Publicado 08 de ago. de 2022
I 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:
var settings = {
url: "insert URL",
headers: {
Authorization: 'Basic ' + btoa("{{setting.token}}:PAT")
},
secure: true,
type: 'GET',
dataType: 'json',
};
Manifest is setup as such:
{
"name": "Project Name",
"author": {
"name": "name",
"email": "email@email.com",
},
"defaultLocale": "en",
"private": true,
"location": {
"support": {
"ticket_sidebar": {
"url": "assets/iframe.html",
"flexible": true
}
}
},
"domainWhitelist": ["whitelistedRequestSite.com"],
"parameters": [
{
"name": "token",
"type": "text",
"secure": true,
"required": true
}
],
"version": "1.0",
"frameworkVersion": "2.0"
}
Thank you to whoever helps in anyway!
0
9
9 comentários
Mathew Ehrenberg
Seems I found the issue. The domainWhiteList property was what was giving issues. Seems I may not have the correct domain in the setting.
0
Mathew Ehrenberg
That's amazing. I'll take a look and update if I have any questions. Thank you!
0
Eric Nelson
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!
1
Mathew Ehrenberg
Yeah. The possible solutions haven't worked. Are there any small details I could be missing?
0
Eric Nelson
Sorry that I missed your response. Are you still having issues?
0
Mathew Ehrenberg
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.
0
Eric Nelson
0
Mathew Ehrenberg
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.
0
Eric Nelson
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!
0
Entrar para comentar.