Get username when using Anonymous Access?

  • Thread starter Thread starter jhcorey
  • Start date Start date
J

jhcorey

We're using a third-party treeview and found that the functionality we
need
works only when we set the web site security to allow Anonymous Access.

We also need the user's network id, which we could get from
System.Web.HttpContext.User.Identity.Name if we don't allow AA.

Is the user's id somehow still accessible in the app even though we're
using
Anonymous Access?
 
No,

The website will be running as whatever account the site is set to run as,
which would most likely be IUSR_[Machine Name], and that is the only
username that System.Web.HttpContext.User.Identity.Name is going to return.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
 
The proper way to fix this would be to get the treeview you're using to work
when your site is not set to anonymous access. What error do you get when
you try the treeview control while set to integrated security?

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
 
By definition you can't get the user identification when anonymous access is
enabled.

I would investigate the problem (you perhaps needs to do that only on a
resource directory used by the treeview ?) and would report the bug to the
treeview vendor if it's turn to be some kind of limitation in this
control...
 
One option may be to, Use forms authentication and authenticate users using
Active Directory/ LogonUser API .

This way, the virtual directory security is set to Anonymous Access , but
the users login with their network credentials. The user enter his network id
in the form and you will be able to access it as in normal forms
authentication..

I think, searching on "Forms authentication, Windows user, Active Directory"
should find some sample code / articles...

but, like others suggested fixing the tree view control may be the right
solution.
 
Thanks for these responses.
We're using a treeview from ComponentArt, and it's not advertised as
maintaing state for nodes we add on the fly. But we found that this
did work if
we use Anonymous Access.

But other requirements of the app include (1) Using windows
authentication so that users don't have to log in (it's strictly an
intranet app); and (2) Being able to save data by the user's network
login id.

So we're definitely going to re-assess the design and do things
differently. I was just looking at all possibilites.
 
Back
Top