473,378 Members | 1,500 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Identifying current user

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
Nov 19 '05 #1
6 1615
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.

--
Best Regards

The Inimitable Mr Newbie º¿º
"Tapi" <t.******@free.fr> wrote in message
news:ez**************@tk2msftngp13.phx.gbl...
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

Nov 19 '05 #2
Anonymous is checked and the problem still exists.

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

"Mr Newbie" <he**@now.com> wrote in message
news:ON**************@TK2MSFTNGP15.phx.gbl...
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.

--
Best Regards

The Inimitable Mr Newbie º¿º
"Tapi" <t.******@free.fr> wrote in message
news:ez**************@tk2msftngp13.phx.gbl...
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


Nov 19 '05 #3
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

--
Best Regards

The Inimitable Mr Newbie º¿º
"Tapi" <t.******@free.fr> wrote in message
news:O9*************@TK2MSFTNGP09.phx.gbl...
Anonymous is checked and the problem still exists.

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

"Mr Newbie" <he**@now.com> wrote in message
news:ON**************@TK2MSFTNGP15.phx.gbl...
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.

--
Best Regards

The Inimitable Mr Newbie º¿º
"Tapi" <t.******@free.fr> wrote in message
news:ez**************@tk2msftngp13.phx.gbl...
> 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
>
>



Nov 19 '05 #4
> Anonymous is checked and the problem still exists.

uncheck it!

"Tapi" <t.******@free.fr> wrote in message
news:O9*************@TK2MSFTNGP09.phx.gbl...
Anonymous is checked and the problem still exists.

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

"Mr Newbie" <he**@now.com> wrote in message
news:ON**************@TK2MSFTNGP15.phx.gbl...
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.

--
Best Regards

The Inimitable Mr Newbie º¿º
"Tapi" <t.******@free.fr> wrote in message
news:ez**************@tk2msftngp13.phx.gbl...
> 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
>
>



Nov 19 '05 #5
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.

"Greg Burns" <bl*******@newsgroups.nospam> wrote in message
news:ek**************@TK2MSFTNGP12.phx.gbl...
Anonymous is checked and the problem still exists.


uncheck it!

"Tapi" <t.******@free.fr> wrote in message
news:O9*************@TK2MSFTNGP09.phx.gbl...
Anonymous is checked and the problem still exists.

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

"Mr Newbie" <he**@now.com> wrote in message
news:ON**************@TK2MSFTNGP15.phx.gbl...
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.

--
Best Regards

The Inimitable Mr Newbie º¿º
"Tapi" <t.******@free.fr> wrote in message
news:ez**************@tk2msftngp13.phx.gbl...
> 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
>
>



Nov 19 '05 #6
For Windows Auth IIS does it for you.
Tapi try reading through :-
http://msdn.microsoft.com/library/de...haspdotnet.asp
Hope that helps
Patrick
"Tapi" <t.******@free.fr> wrote in message
news:ev**************@TK2MSFTNGP10.phx.gbl...
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.

"Greg Burns" <bl*******@newsgroups.nospam> wrote in message
news:ek**************@TK2MSFTNGP12.phx.gbl...
Anonymous is checked and the problem still exists.
uncheck it!

"Tapi" <t.******@free.fr> wrote in message
news:O9*************@TK2MSFTNGP09.phx.gbl...
Anonymous is checked and the problem still exists.

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

"Mr Newbie" <he**@now.com> wrote in message
news:ON**************@TK2MSFTNGP15.phx.gbl...
> 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.
>
> --
> Best Regards
>
> The Inimitable Mr Newbie º¿º
>
>
> "Tapi" <t.******@free.fr> wrote in message
> news:ez**************@tk2msftngp13.phx.gbl...
> > 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
> >
> >
>
>



Nov 19 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Mark | last post by:
I have an application that uses PHP to access a MySQL table and extract rows which match the user's search entry. Data from the matching rows are loaded into an HTML selection list, and the user...
1
by: David | last post by:
I know that identifying the user IP address with HTTP_SERVER_VARS; is reliant on the browser agent but I have stumpled upon the following code which I have tried to understand but failed! ...
7
by: Don Riesbeck Jr. | last post by:
I'm working on an application (OEM) using C# that utilizes input from a keyboard, and USB Barcode Scanner. The scanner is a HID Keyboard device, and input from it is sent to the system as if it...
3
by: Christopher Weaver | last post by:
I want to set a value in a specific field in the current row of a DataSet. This seems like the most basic thing to do but I can't find the syntax for identifying the current row. IOW, I can do...
9
by: Tapi | last post by:
Hello, I am using Visual SourceSafe to work on a project in a team of three. I have created a Windows group caleed "Application_MO" on my machine and added my Windows login to it. However,...
3
by: bwmbagus | last post by:
I am getting a strange result from some standard code. Anyone got any ideas?? The puzzle I have a web service calling System.Environment.UserName etc to return the user name from the server....
0
by: Jack Kerkhof | last post by:
We have a database that sets a column called MOD_BY = CURRENT_USER to almost all tables on INSERT and UPDATE. But now that the application is n-tier, and uses connection pools, the current_user...
3
by: Anbu | last post by:
Hi All, I'm hosting WSE 3.0 SoapService based web service, which uses Basic authentication. Since, it's implemented from SoapService, a receiver function receives the soapenvelope. Client...
10
by: Frankie | last post by:
It appears that System.Random would provide an acceptable means through which to generate a unique value used to identify multiple/concurrent asynchronous tasks. The usage of the value under...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.