Hi there,I want to get username without Windows Authentication.
let me explain more,I have a web site which is published in IIS,to access pages users should be authenticated and then access to pages.
as we know there are two kinds of authentication,I don't want to use Windows Authentication because of some these reasons:
each user to access pages must enter username and password in browsers pop up.
I have implemented a class which can add trusted IP addresses in browsers to avoid entering username and password,but it's not reliable,why?because it must be published and then it should be installed in every client computers.
I have googled so much to find a way about accessing username,another thing I tried was about registy (last logged in user),it works fine in console but as soon as I publish my website in IIS,it retrives last loggedin user in IIS(i mean if I set my website
in Server B it retrives last logged in user in server B ,not in client).
so beside of thsese steps,is there any way to get username(the user which has authenticated in windows)?
my problem is in here,if I authenticate user,I can get username,but I don't want to authenticate.
imagine that in loginpage.aspx
I have two textbox,username and password,I want to show username automatically(username which already logged in in windows,but I don't want to use windows authetication ),and user just enter his/her password.
No matter you use windows or forms authenticaion, your web application or IIS server will ask the client to supply credentials for authentication. For windows authentication, the IIS windows authentication module will send challenge to client so that the
client browser will send the authenitcation header(contains the windows user identity info) to server. If you turn off windows authentication(use anonymous access), there is no information sent to server, and you will not be able to get client user identity
info in your ASP.NET app.
If you do want to get clientt user identity without using windows auth at the server, then one means is to use rich web client (such as activeX control or silverlight). Since rich web client can support strong typed code like C# , VB, C++ which can use the
certain API to get the client user information and send them to server. But deploying rich web client add more overhead and complexity and is probably not what you want.
vahid.ch
Member
294 Points
331 Posts
Get Loggedinuser
May 02, 2012 05:00 AM|LINK
Hi there,I want to get username without Windows Authentication.
let me explain more,I have a web site which is published in IIS,to access pages users should be authenticated and then access to pages.
as we know there are two kinds of authentication,I don't want to use Windows Authentication because of some these reasons:
I have googled so much to find a way about accessing username,another thing I tried was about registy (last logged in user),it works fine in console but as soon as I publish my website in IIS,it retrives last loggedin user in IIS(i mean if I set my website in Server B it retrives last logged in user in server B ,not in client).
so beside of thsese steps,is there any way to get username(the user which has authenticated in windows)?
tnx in advanced.
ashu_123
Member
36 Points
9 Posts
Re: Get Loggedinuser
May 02, 2012 09:31 AM|LINK
If you are not using Windows authentication, means you are using Forms authentication .
If yes than in Forms authentication you can get current user's username by
User.identity.name
Thanks,
Ashwini
vahid.ch
Member
294 Points
331 Posts
Re: Get Loggedinuser
May 02, 2012 09:57 AM|LINK
my problem is in here,if I authenticate user,I can get username,but I don't want to authenticate.
imagine that in loginpage.aspx
I have two textbox,username and password,I want to show username automatically(username which already logged in in windows,but I don't want to use windows authetication ),and user just enter his/her password.
BrockAllen
All-Star
28084 Points
4997 Posts
MVP
Re: Get Loggedinuser
May 02, 2012 04:10 PM|LINK
How do you distinguish between two different users with the same password?
DevelopMentor | http://www.develop.com
thinktecture | http://www.thinktecture.com/
Steven Cheng...
Contributor
4219 Points
548 Posts
Microsoft
Moderator
Re: Get Loggedinuser
May 03, 2012 02:32 AM|LINK
Hi vahid.ch,
No matter you use windows or forms authenticaion, your web application or IIS server will ask the client to supply credentials for authentication. For windows authentication, the IIS windows authentication module will send challenge to client so that the client browser will send the authenitcation header(contains the windows user identity info) to server. If you turn off windows authentication(use anonymous access), there is no information sent to server, and you will not be able to get client user identity info in your ASP.NET app.
#Explained: Windows Authentication in ASP.NET 2.0
http://forums.asp.net/t/1799041.aspx
If you do want to get clientt user identity without using windows auth at the server, then one means is to use rich web client (such as activeX control or silverlight). Since rich web client can support strong typed code like C# , VB, C++ which can use the certain API to get the client user information and send them to server. But deploying rich web client add more overhead and complexity and is probably not what you want.
Feedback to us
Microsoft One Code Framework
vahid.ch
Member
294 Points
331 Posts
Re: Get Loggedinuser
May 03, 2012 03:44 AM|LINK
as I mentioned,after loading loginpage.aspx,I want user name be added automatically.
If I have username,it's no diffrent I have same password or not.
because I'm logging with username not password.
thanks.