Click here to Skip to main content
15,905,785 members
Home / Discussions / ASP.NET
   

ASP.NET

 
Questionweb.config problem Pin
Jassim Rahma24-Sep-10 11:49
Jassim Rahma24-Sep-10 11:49 
AnswerRe: web.config problem Pin
Not Active25-Sep-10 9:38
mentorNot Active25-Sep-10 9:38 
GeneralRe: web.config problem Pin
Jassim Rahma25-Sep-10 10:27
Jassim Rahma25-Sep-10 10:27 
GeneralRe: web.config problem Pin
Not Active25-Sep-10 11:32
mentorNot Active25-Sep-10 11:32 
GeneralRe: web.config problem Pin
Gamzun25-Sep-10 21:30
Gamzun25-Sep-10 21:30 
GeneralRe: web.config problem Pin
Jassim Rahma25-Sep-10 21:40
Jassim Rahma25-Sep-10 21:40 
GeneralRe: web.config problem Pin
Gamzun4-Oct-10 20:36
Gamzun4-Oct-10 20:36 
QuestionAnonymous usser URL access testing issues Pin
jboyd11124-Sep-10 11:04
jboyd11124-Sep-10 11:04 
I've written a simple web app to test the URLs of our various internal applications to ensure none would allow anonymous login access. I thought all was working fine until another developer mentioned that one of the URLs should be accessible to anonymous users.
We use Active directory logins/passwords and membership in order to provide/restrict access to certain pages and applications.
When set to default credentials, I get no errors.
When I set my network credentials to some made-up user, I get 401 errors, as expected for all URLs. For the URL in question that's accessible to internal anonymous (i.e. not logged-into-this-particular-app) users, I get the "401 access denied" message as well.

Here are the main parts of the code:

<br />
NetworkCredential networkCredential = new NetworkCredential("stan", "abc123");<br />
                    HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://www.SomeTestURLHere.com/default.aspx");<br />
<br />
                    CookieContainer cookieContainer = new CookieContainer();<br />
                    request.CookieContainer = cookieContainer; <br />
<br />
                    request.Credentials = networkCredential;<br />
   <br />
                    using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())<br />
                    using (Stream dataStream = response.GetResponseStream())<br />
                    using (StreamReader reader = new StreamReader(dataStream))<br />
{ <br />
// do work<br />
}<br />
<br />


This is all contained within a try-catch-finally block. With default credentials, I fall through into the "do work" section of the code.
With the network credentials I set above, I get the "401" exception, which I would NOT expect for this particular URL since it's supposed to allow anonymous user access.

So my question is: why am I getting the 401 message for this page?

Thanks in advance for any assistance you can provide.
----
Jboyd

AnswerRe: Anonymous usser URL access testing issues Pin
T M Gray24-Sep-10 11:37
T M Gray24-Sep-10 11:37 
GeneralRe: Anonymous usser URL access testing issues Pin
jboyd11127-Sep-10 3:50
jboyd11127-Sep-10 3:50 
GeneralRe: Anonymous usser URL access testing issues Pin
jboyd11127-Sep-10 9:30
jboyd11127-Sep-10 9:30 
QuestionGetting gridview to rebind inside of a modalpopup control Pin
Aptiva Dave24-Sep-10 8:58
Aptiva Dave24-Sep-10 8:58 
AnswerRe: Getting gridview to rebind inside of a modalpopup control Pin
Karthik. A24-Sep-10 11:58
Karthik. A24-Sep-10 11:58 
QuestionProblem with http handlers Pin
Haim Nachum24-Sep-10 5:59
Haim Nachum24-Sep-10 5:59 
AnswerRe: Problem with http handlers Pin
NeverHeardOfMe24-Sep-10 9:31
NeverHeardOfMe24-Sep-10 9:31 
QuestionUrl refere is null in safari Pin
MayukhSen23-Sep-10 20:33
MayukhSen23-Sep-10 20:33 
AnswerRe: Url refere is null in safari Pin
sashidhar24-Sep-10 0:44
sashidhar24-Sep-10 0:44 
QuestionStored Procedure Call - Comments with Single Quote Pin
Civic0623-Sep-10 7:26
Civic0623-Sep-10 7:26 
AnswerRe: Stored Procedure Call - Comments with Single Quote Pin
Karthik. A23-Sep-10 8:16
Karthik. A23-Sep-10 8:16 
AnswerRe: Stored Procedure Call - Comments with Single Quote Pin
Blue_Boy23-Sep-10 20:46
Blue_Boy23-Sep-10 20:46 
Questionadding Ajax Tooklit Pin
future383922-Sep-10 16:32
future383922-Sep-10 16:32 
AnswerRe: adding Ajax Tooklit Pin
Abhijit Jana22-Sep-10 19:30
professionalAbhijit Jana22-Sep-10 19:30 
GeneralRe: adding Ajax Tooklit Pin
future383923-Sep-10 3:54
future383923-Sep-10 3:54 
AnswerRe: adding Ajax Tooklit Pin
Brij22-Sep-10 19:49
mentorBrij22-Sep-10 19:49 
QuestionAjax in ASP.Net Pin
future383922-Sep-10 15:10
future383922-Sep-10 15:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.