Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The remote server returned an error: (403) Forbidden

Tags:

c#

People also ask

Why do I get Error 403 Forbidden?

The 403 Forbidden error appears when your server denies you permission to access a page on your site. This is mainly caused by a faulty security plugin, a corrupt . htaccess file, or incorrect file permissions on your server.

Can a VPN cause a 403 error?

Some websites block VPN users and will show a 403 Forbidden message if you try connecting to them through a VPN. If you suspect this is the problem, you can disconnect from your VPN and then try connecting to the website.

Is Error 403 an IP ban?

403 Forbidden. Your IP has been blocked due to suspected abuse, please contact [email protected] in order to get this issue resolved. This error is returned when an IP has been blocked due to suspected abuse.


Add the following line:

request.UseDefaultCredentials = true;

This will let the application use the credentials of the logged in user to access the site. If it's returning 403, clearly it's expecting authentication.

It's also possible that you (now?) have an authenticating proxy in between you and the remote site. In which case, try:

request.Proxy.Credentials = System.Net.CredentialCache.DefaultCredentials;

Hope this helps.


Looks like problem is based on a server side.

Im my case I worked with paypal server and neither of suggested answers helped, but http://forums.iis.net/t/1217360.aspx?HTTP+403+Forbidden+error

I was facing this issue and just got the reply from Paypal technical. Add this will fix the 403 issue. HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url);
req.UserAgent = "[any words that is more than 5 characters]";


Its a permissions error. Your VS probably runs using an elevated account or different user account than the user using the installed version.

It may be useful to check your IIS permissions and see what accounts have access to the resource you are accessing. Cross reference that with the account you use and the account the installed versions are using.


We should access the website using the name given in the certificate.enter image description here