We help IT Professionals succeed at work.

User credentials client side

Hey All

I would like to create a Webapplication that asks the Client side for the username being logged on

Can that be done


basically I would like the current user logged on with on the client side
Comment
Watch Question

Commented:
Hi,

is your webapplication running in tje same network as teh clients ?

Commented:
You can change the settings in your IIS server to use windows authentication instead of anonymous.
Change this setting in the "Internet Information Services (IIS) Manager".

Author

Commented:
well the thing is I have an application that has its own method of authentication

however for ease of use i would like it to get the username and log them in directly

"single Sign on", you see the username is used to get info about printjobs for a user and I need the username to get them

Commented:
What membership provider are you using?  Do the usernames match up with the usernames used for the print jobs?

Author

Commented:
YEs they do

Commented:
Then just get the username via: Page.CurrentUser

Author

Commented:
I cant seem to find Page.CurrentUser  There is a user though

i set it up as


   string username = Page.User.ToString();
          Response.Write("user name one is " + username);



and the output was
user name one is System.Security.Principal.WindowsPrincipal

Author

Commented:
Another point is I set up the application on IIS to allow annonymous access,that could be the reason the user isnt being read properly

username comes up blank

The aim of all of this is that i want to get the username to allow single sign on capability on my application
Commented:
Hi,

since they are all users on your network they are authenticated, so you can deny anonymous on your IIs server en leave windows authentication on. I tested here with my loacl IIs server and that works fine.

Its also Page.User.Identity.Name instead of Page.User
Filip

Author

Commented:
thats briliant filip that worked

thanks again