Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
|
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 15th, 2006, 10:30 AM
Registered User
 
Join Date: May 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default User.Identity.Name and accessing it from code

Network admins at my company did something...took away privileges and add others and now my report interface no longer is able to read the user accessing the reports. This is important because there is code that is dependent upon the user that logs in. I need help trying to figure out what went wrong so I can fix it because they don't think they did anything wrong. Where do I start?

User.Identity.Name used to return the username logging into the application. Now it returns nothing, so certain users are unable to access their special reports.

Help?!?!


 
Old May 16th, 2006, 01:54 PM
Authorized User
 
Join Date: May 2006
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The first thing I would do is find out if the admins turned on "Anonymous Access" in IIS. If they did that for the virtual folder in which your application resides (or any virtual folder above it), then client machines will no longer send certificate information to the web server, and User.Identity.Name will have nothing (same problem as the Request.ServerVariables collection).

Brandon
 
Old May 16th, 2006, 02:01 PM
Registered User
 
Join Date: May 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Anonymous Access is turned on, but that is the only way the application will work. When I turn it off I get an error screen...

 
Old May 24th, 2006, 04:41 PM
Authorized User
 
Join Date: May 2006
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Is it the infinitely usefull "Page Cannot Be Displayed" error? It's possible that there's an error in the ASP somewhere that only surfaces when User.Identity.Name actually has a value. Whatever the cause, if Anonymous Access is enabled in IIS, there is no way to automatically detect the user from the Web server. In the right environment, you might be able to use Client-side Javascript to detect the user and pass the username through a hidden form. Check out the "WScript.Network" ActiveX Object for details.

Brandon





Similar Threads
Thread Thread Starter Forum Replies Last Post
User Identity stonesbg ASP.NET 2.0 Basics 1 February 9th, 2007 11:14 AM
Context.User.Identity.Name jimbeam36 BOOK: ASP.NET Website Programming Problem-Design-Solution 4 November 6th, 2004 06:33 AM
Accessing Web User Controls from code aquaboltar ASP.NET 2.0 Basics 0 October 26th, 2004 04:04 PM
ascx issue with User.Identity.Name ian.macey Classic ASP Basics 2 June 11th, 2003 02:50 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.