Hello, my mapping application uses a GP service to save some info to a .txt located on the server. The GP service is secured through Portal. I was able to save data via the GP service rest endpoint without any issues. However, when I used JavaScript API to do that (codes are below) in WAB, the Modified Date of the file was updated but no data was saved. "Error: token required..." was thrown in Concole. I guess this was related to the secured GP service. How to add a credential to the Geoprocessor? Thanks for your help!
