Getting Remote Windows Username on Intranet

Getting Remote Windows Username on Intranet

am 29.09.2007 23:03:36 von ragearc

Hey there. I'm currently working on an intranet, and would like to
know how I can get the windows usernames of the visitors.

You can get their IP with $_SERVER['REMOTE_ADDR'];

But what about their Windows Username? Is there any way of doing so?
Through the Intranet?

Re: Getting Remote Windows Username on Intranet

am 30.09.2007 00:36:52 von Brendan Gillatt

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Bruno Barros wrote:
> Hey there. I'm currently working on an intranet, and would like to
> know how I can get the windows usernames of the visitors.
>
> You can get their IP with $_SERVER['REMOTE_ADDR'];
>
> But what about their Windows Username? Is there any way of doing so?
> Through the Intranet?
>

No unless you use ActiveX

- --
Brendan Gillatt
brendan {at} brendangillatt {dot} co {dot} uk
http://www.brendangillatt.co.uk
PGP Key: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xBACD7433
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (MingW32)

iD8DBQFG/tOEkA9dCbrNdDMRArvrAJ9h0nlZp0c02kiQLeYLsdqeQyq7KwCg mu23
i531jhYaBDCV2RuGUiqlxCY=
=XHAi
-----END PGP SIGNATURE-----

Re: Getting Remote Windows Username on Intranet

am 30.09.2007 01:48:46 von ragearc

On 29 Sep, 23:36, Brendan Gillatt
wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Bruno Barros wrote:
> > Hey there. I'm currently working on an intranet, and would like to
> > know how I can get the windows usernames of the visitors.
>
> > You can get their IP with $_SERVER['REMOTE_ADDR'];
>
> > But what about their Windows Username? Is there any way of doing so?
> > Through the Intranet?
>
> No unless you use ActiveX
>
> - --
> Brendan Gillatt
> brendan {at} brendangillatt {dot} co {dot} ukhttp://www.brendangillatt.co.uk
> PGP Key:http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xBACD 7433
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.3 (MingW32)
>
> iD8DBQFG/tOEkA9dCbrNdDMRArvrAJ9h0nlZp0c02kiQLeYLsdqeQyq7KwCg mu23
> i531jhYaBDCV2RuGUiqlxCY=
> =XHAi
> -----END PGP SIGNATURE-----

Other than that? Anything?

Re: Getting Remote Windows Username on Intranet

am 30.09.2007 04:36:23 von Jerry Stuckle

Bruno Barros wrote:
> On 29 Sep, 23:36, Brendan Gillatt
> wrote:
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> Bruno Barros wrote:
>>> Hey there. I'm currently working on an intranet, and would like to
>>> know how I can get the windows usernames of the visitors.
>>> You can get their IP with $_SERVER['REMOTE_ADDR'];
>>> But what about their Windows Username? Is there any way of doing so?
>>> Through the Intranet?
>> No unless you use ActiveX
>>
>> - --
>> Brendan Gillatt
>> brendan {at} brendangillatt {dot} co {dot} ukhttp://www.brendangillatt.co.uk
>> PGP Key:http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xBACD 7433
>> -----BEGIN PGP SIGNATURE-----
>> Version: GnuPG v1.4.3 (MingW32)
>>
>> iD8DBQFG/tOEkA9dCbrNdDMRArvrAJ9h0nlZp0c02kiQLeYLsdqeQyq7KwCg mu23
>> i531jhYaBDCV2RuGUiqlxCY=
>> =XHAi
>> -----END PGP SIGNATURE-----
>
> Other than that? Anything?
>

Not a chance. Not meant to be rude, but what business is it of yours? I
would be very upset if any site wanted my window user name. That's
between me and my network.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Re: Getting Remote Windows Username on Intranet

am 30.09.2007 05:09:48 von klenwell

On Sep 29, 7:36 pm, Jerry Stuckle wrote:
> Bruno Barros wrote:
> > On 29 Sep, 23:36, Brendan Gillatt
> > wrote:
> >> -----BEGIN PGP SIGNED MESSAGE-----
> >> Hash: SHA1
>
> >> Bruno Barros wrote:
> >>> Hey there. I'm currently working on an intranet, and would like to
> >>> know how I can get the windows usernames of the visitors.
> >>> You can get their IP with $_SERVER['REMOTE_ADDR'];
> >>> But what about their Windows Username? Is there any way of doing so?
> >>> Through the Intranet?
> >> No unless you use ActiveX
>
> >> - --
> >> Brendan Gillatt
> >> brendan {at} brendangillatt {dot} co {dot} ukhttp://www.brendangillatt.co.uk
> >> PGP Key:http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xBACD 7433
> >> -----BEGIN PGP SIGNATURE-----
> >> Version: GnuPG v1.4.3 (MingW32)
>
> >> iD8DBQFG/tOEkA9dCbrNdDMRArvrAJ9h0nlZp0c02kiQLeYLsdqeQyq7KwCg mu23
> >> i531jhYaBDCV2RuGUiqlxCY=
> >> =XHAi
> >> -----END PGP SIGNATURE-----
>
> > Other than that? Anything?
>
> Not a chance. Not meant to be rude, but what business is it of yours? I
> would be very upset if any site wanted my window user name. That's
> between me and my network.
>
> --
> ==================
> Remove the "x" from my email address
> Jerry Stuckle
> JDS Computer Training Corp.
> jstuck...@attglobal.net
> ==================

---

Bruno mentioned "intranet" so I think the idea is that the script
would only be looking for the username or credentials of a user who's
logged into the network.

Would this be the idea?

Integrating Active Directory with PHP
http://www.developer.com/lang/php/article.php/10941_3100951_ 1

Re: Getting Remote Windows Username on Intranet

am 30.09.2007 13:05:32 von ragearc

On 30 Sep, 04:09, klenwell wrote:
> On Sep 29, 7:36 pm, Jerry Stuckle wrote:
>
>
>
> > Bruno Barros wrote:
> > > On 29 Sep, 23:36, Brendan Gillatt
> > > wrote:
> > >> -----BEGIN PGP SIGNED MESSAGE-----
> > >> Hash: SHA1
>
> > >> Bruno Barros wrote:
> > >>> Hey there. I'm currently working on an intranet, and would like to
> > >>> know how I can get the windows usernames of the visitors.
> > >>> You can get their IP with $_SERVER['REMOTE_ADDR'];
> > >>> But what about their Windows Username? Is there any way of doing so?
> > >>> Through the Intranet?
> > >> No unless you use ActiveX
>
> > >> - --
> > >> Brendan Gillatt
> > >> brendan {at} brendangillatt {dot} co {dot} ukhttp://www.brendangillatt.co.uk
> > >> PGP Key:http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xBACD 7433
> > >> -----BEGIN PGP SIGNATURE-----
> > >> Version: GnuPG v1.4.3 (MingW32)
>
> > >> iD8DBQFG/tOEkA9dCbrNdDMRArvrAJ9h0nlZp0c02kiQLeYLsdqeQyq7KwCg mu23
> > >> i531jhYaBDCV2RuGUiqlxCY=
> > >> =XHAi
> > >> -----END PGP SIGNATURE-----
>
> > > Other than that? Anything?
>
> > Not a chance. Not meant to be rude, but what business is it of yours? I
> > would be very upset if any site wanted my window user name. That's
> > between me and my network.
>
> > --
> > ==================
> > Remove the "x" from my email address
> > Jerry Stuckle
> > JDS Computer Training Corp.
> > jstuck...@attglobal.net
> > ==================
>
> ---
>
> Bruno mentioned "intranet" so I think the idea is that the script
> would only be looking for the username or credentials of a user who's
> logged into the network.
>
> Would this be the idea?
>
> Integrating Active Directory with PHPhttp://www.developer.com/lang/php/article.php/10941_31009 51_1

Yes it is. I am developing a website for an Intranet and would like
the Windows Username to be the username to be used inside the intranet
(kind of automatic login).

Re: Getting Remote Windows Username on Intranet

am 30.09.2007 15:19:56 von Jerry Stuckle

Bruno Barros wrote:
> On 30 Sep, 04:09, klenwell wrote:
>> On Sep 29, 7:36 pm, Jerry Stuckle wrote:
>>
>>
>>
>>> Bruno Barros wrote:
>>>> On 29 Sep, 23:36, Brendan Gillatt
>>>> wrote:
>>>>> -----BEGIN PGP SIGNED MESSAGE-----
>>>>> Hash: SHA1
>>>>> Bruno Barros wrote:
>>>>>> Hey there. I'm currently working on an intranet, and would like to
>>>>>> know how I can get the windows usernames of the visitors.
>>>>>> You can get their IP with $_SERVER['REMOTE_ADDR'];
>>>>>> But what about their Windows Username? Is there any way of doing so?
>>>>>> Through the Intranet?
>>>>> No unless you use ActiveX
>>>>> - --
>>>>> Brendan Gillatt
>>>>> brendan {at} brendangillatt {dot} co {dot} ukhttp://www.brendangillatt.co.uk
>>>>> PGP Key:http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xBACD 7433
>>>>> -----BEGIN PGP SIGNATURE-----
>>>>> Version: GnuPG v1.4.3 (MingW32)
>>>>> iD8DBQFG/tOEkA9dCbrNdDMRArvrAJ9h0nlZp0c02kiQLeYLsdqeQyq7KwCg mu23
>>>>> i531jhYaBDCV2RuGUiqlxCY=
>>>>> =XHAi
>>>>> -----END PGP SIGNATURE-----
>>>> Other than that? Anything?
>>> Not a chance. Not meant to be rude, but what business is it of yours? I
>>> would be very upset if any site wanted my window user name. That's
>>> between me and my network.
>>> --
>>> ==================
>>> Remove the "x" from my email address
>>> Jerry Stuckle
>>> JDS Computer Training Corp.
>>> jstuck...@attglobal.net
>>> ==================
>> ---
>>
>> Bruno mentioned "intranet" so I think the idea is that the script
>> would only be looking for the username or credentials of a user who's
>> logged into the network.
>>
>> Would this be the idea?
>>
>> Integrating Active Directory with PHPhttp://www.developer.com/lang/php/article.php/10941_31009 51_1
>
> Yes it is. I am developing a website for an Intranet and would like
> the Windows Username to be the username to be used inside the intranet
> (kind of automatic login).
>

OK, I misread intranet as "internet". Sorry.

The only way you can do this is with an ActiveX control. Nothing in the
browser will pass it on, and nothing on the server can look at it.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Re: Getting Remote Windows Username on Intranet

am 30.09.2007 16:32:28 von Andy Hassall

On Sat, 29 Sep 2007 14:03:36 -0700, Bruno Barros wrote:

>Hey there. I'm currently working on an intranet, and would like to
>know how I can get the windows usernames of the visitors.
>
>You can get their IP with $_SERVER['REMOTE_ADDR'];
>
>But what about their Windows Username? Is there any way of doing so?
>Through the Intranet?

Well, yes, sort of, with limitations, and it's not exactly recommended. Look
up "NTLM".

If you're running IIS on Windows, turn on "Integrated Windows Authentication"
for the particular directory.

For Apache, there are a couple of other options, further depending on whether
you're on Windows or UNIX, for example, http://mod-auth-sspi.sourceforge.net/
or http://modntlm.sourceforge.net/ . (I've not been able to get the latter to
work at all with Apache 2.2 on Linux, but YMMV).

IE will respond automatically to the authentication challenge this sends, and
you'll get Windows username as one of the $_SERVER variables.

Firefox supports method, but users would have to manually modify the
"network.automatic-ntlm-auth.trusted-uris" option in about:config to trust your
intranet site, otherwise they get a prompt to re-enter their Windows username
and passwords.

Last time I checked Opera eitehr didn't have support for this, or it was still
beta, and disabled by default (and only re-enable-able through a hidden
option), so you'd better have a fallback.

If you go this route then bear in mind that it's not very widely used so you
won't have as much support from the community. The implementations are all
reverse-engineered (other than the native Windows/IIS one, obviously), so may
well have weird quirks.

Even if you did get this working, it's almost certainly best not to rely on
this as your authentication method on every page, instead to have it as an
*option* on your login page to identify and authenticate the user, and then use
your own method to keep the user logged in (sessions, cryptographically signed
cookies, the usual suspects here).

--
Andy Hassall :: andy@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool

Re: Getting Remote Windows Username on Intranet

am 30.09.2007 21:27:26 von Michael Fesser

..oO(Bruno Barros)

>Yes it is. I am developing a website for an Intranet and would like
>the Windows Username to be the username to be used inside the intranet
>(kind of automatic login).

You could have a look at the proprietary NTLM authentication mechanism.

Micha