I am writing a custom app that integrates to another platform using OAuth, I have managed to configure everything appropriately as described here and here, however, invoking the request method that uses oauth authentication fails with an error Error while substituting templates. on console logs when testing on my local machine. FDK debug logs show an error error while validating schema for {{templateName}} . Only the access_token is to be substituted in request schema’s header object, if I remove the access_token substitution and copy paste the token directly in the header schema, the request works as expected. The access_token is correctly fetched and stored in browser’s localstorage via OAuth since the token_type is agent. I am on the latest fdk version 9.0.1. I have checked other threads on this topic but it seems my issue is unique to them. I don’t know if there’s a limit to token length which could be causing the failure because our access_token is quite long otherwise I have run out of options to try make it work. Kindly advise urgently.
I see that you are referring to OAuth credentials available in the browser’s localstore, are you testing the app locally by running fdk run or is the app packed and deployed as the custom app where it’s erroring up?
Can you share your oauth_config.json file with removing the values for client_id and client_secret?
When the run the app fdk run, this would create a .fdk directory in your local app directory which would contain localstore and the JSON would have access_token in there. Do you see that? And still, the value is not being substituted?
Hi @zach_jones_noel ,
Yes I see the .fdk folder, I see the localstore JSON but it only has two properties: xxxx_oauth_iparams and xxxx_oauth_appstate. There is no access_token in there, however, didn’t i read here (last statement on the page literally) that if the token_type is agent (agent level authentication) then the access_token would be persisted in browser’s local storage?
This was the basis for my query because I can see the access_token in browser’s local storage for this particular custom app running on my local as shown in the except below.
This app is being implemented against the latest fdk version 9 as development started just about a month ago. It has not been implemented on fdk 8 as it is a new app being developed from scratch.
Did you find something that’s causing this issue please? Unfortunately we are at a critical stage with the project requiring this integration so we take decision whether custom app will work for our requirements or not.
If you didn’t find something yet, I don’t know if this can help in the investigations but would token length be suspect of interest causing this error as I mentioned in the original post because ours is quite lengthy??