How to check if loggedin user can access another internal site in asp.net

  • Thread starter Thread starter Narendra Reddy Vajrala
  • Start date Start date
N

Narendra Reddy Vajrala

Guest
Hi Team,

i need to check if logged in user (Windows users) have access to a particular site from another site (both are intranet).

i am using below code i am using in my application, but it always throwing exception 403 forbidden error. i can access the site that i am trying from browser.

var request = (HttpWebRequest)WebRequest.Create("My Application url here");
request.UseDefaultCredentials = true;
request.Proxy.Credentials = CredentialCache.DefaultCredentials;
using (HttpWebResponse response = request.GetResponse() as HttpWebResponse) // here 403 forbidden exception throwing.
{
int statusCode = (int)response.StatusCode;
}





any help on this would be appreciated highly.

Continue reading...
 
Back
Top