2

I have this simple C# code in my SSIS package:

string ViewMetadata = "https://people.zoho.eu/people/api/views?authtoken=XXXXXX";
System.Net.WebClient Client = new System.Net.WebClient();
var data= Client.DownloadString(ViewMetadata);

It worked fine before but after access token got expired and we changed it. it doesn't work anymore and I get the error(403 forbidden).

the weird part is I can open this URL on chrome (with my new private access token instead of XXXX) and even when I use a simple C# solution outside of SSIS it works fine. I searched for it and people suggest to add headers so I tried everything but nothing works for me. (WebClient 403 Forbidden)

also if I change the URL to something else like "google.com" everything works fine even in SSIS.

Thanks for help

EDIT: Nothing about Access token matters here because you can get an error page with this random access token but I get the error 403 in SSIS.

Hooman Nemati
  • 97
  • 1
  • 7
  • 2
    So, the access token expired and you generated a new one. You updated the script to use the new token and it continues not working. However, using the same token in a browser works fine, yeah? To verify there's no credential caching going on, I'd open a private/incognito browsing session (Windows, Shift-N in Chrome. Win, Shift-P in most other browsers) and then confirm the token continues to work there. If so, then the problem is the SSIS script. If not, then it's something with the token itself – billinkc Feb 17 '19 at 15:06
  • there is nothing about the access token because even if you test this URL (https://people.zoho.eu/people/api/views?authtoken=XXXXXX) It give an Error that I can read in C# but I get error 403 in SSIS. – Hooman Nemati Feb 18 '19 at 07:00
  • 2
    TLS, just tested on my machine and your code above was returning 403 at first. I added "ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;" now it's returning 400 bad request. Depending on what version of data tools and .net your using it's not defaulting to TLS 1.2 and zoho is enforcing it, causing the 403 error. – Tim Mylott Feb 18 '19 at 14:43

0 Answers0