Identifying current user

T

Tapi

Hello,

I can easily get the Windows login of the current user on my machine by
using:

User_login = HttpContext.Current.User.Identity.Name()



However once, I copy the aspx and corresponding files to the production
server, the variable "User_login" is empty, i.e. the currently logged in
user is not recognised.

What could be the problem?



Thanls
 
M

Mr Newbie

You need to check the type of Authentication you have setup on the project
on the target server and if anonymous access has been left check or not.

Check in web.config and your IIS settings for the project on the target
machine.
 
T

Tapi

Anonymous is checked and the problem still exists.

IIS settings on the target server seem to be all fine.
 
M

Mr Newbie

But how is your authorisation set ?, are making users sign on ?

The only other thing I can think of is if when you authenticate you dont use
the FormsAuthentication.Redirect..... and use something else like a
response.redirect I have seen the same thing happen.

There hast to be a configuration issue between your machine and the server
and the only thing which would affect this as far as I know are the
following.

1.) Authentication Method
2.) Authorisation settings
3.) Impersonation

If you are truly athenticated you can check this using the User
..IsAuthenticated Or whatever property it is
 
T

Tapi

The problem was actually because of Anonymous being checked. I was of the
impression that I had tested the application with Anonymous unchecked, but
no.

Thanks everybody for your help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,049
Latest member
Allen00Reed

Latest Threads

Top