views:

190

answers:

1

I need to make a simple knowledge-base type application to use in company internal network. To make it simple and fast to use for end-users I would like to skip all the login in part (as it will be only visible to internal network users who we trust anyway) and automaticly pull the domain user name from the user and put it into the database (don't want people to waste time manually entering their name; the littler time they waste using the app, the higher chance they will actually use it).

So, is it possible to get that kind of information on a server? Do windows browsers send it in some headers that I could trust to be there?

+1  A: 

If you are using IIS and Internet Explorer, you could turn on 'Integrated Windows Authentication' (NTLM authentication). This causes IE to automatically authenticate the user using your domain infrastructure. After automatic login, you can access the user name using the environment variable LOGON_USER. There is also a module for Apache (mod_ntlm) for this purpose, although I don't know its status.

Maybe you could event try to implement NTLM authentication yourself, but this will certainly be a lot of work.

Other than that, there seems to be no way since no reasonable browser will send the user name...


EDIT: It seems that python-win32 extensions or python-ntlm could do the trick, check out this thread. You still have to integrate it into Django, though.

Ferdinand Beyer