Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: How to get the Windows User Name that connect to my IntraWeb server?



Permlink Replies: 5 - Last Post: Feb 9, 2015 6:29 AM Last Post By: Pieter van Wyk
Roman Bay

Posts: 16
Registered: 6/14/13
How to get the Windows User Name that connect to my IntraWeb server?
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 27, 2015 8:56 AM
I need to get the Windows User Name that connect to my IntraWeb server.

I know how to do it in Internet Explorer(with using ActiveXObject). But this solution does not suit me because ActiveX doesn't work for other browsers(Chrome or Firefox). Extensions for browsers such as IE-Tab is not suitable solution.

Maybe somebody knows any other ways or some examples?

Please, help me!

Edited by: Roman Bay on Jan 27, 2015 8:57 AM
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: How to get the Windows User Name that connect to my IntraWeb server?[Edit]
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 27, 2015 9:47 AM   in response to: Roman Bay in response to: Roman Bay
Roman wrote:

I need to get the Windows User Name that connect to my IntraWeb
server.

You may have to use NTLM authentication on your server so the client can
use its Windows logon credentials to sign in to your server.

I know how to do it in Internet Explorer(with using ActiveXObject).
But this solution does not suit me because ActiveX doesn't work for
other browsers(Chrome or Firefox). Extensions for browsers such as
IE-Tab is not suitable solution.

Maybe somebody knows any other ways or some examples?

There is no other option. What you are asking for is not standard HTTP practice.
ActiveX works because it runs on the client's machine, so it has access
to the user account that is running the browser.

--
Remy Lebeau (TeamB)
Lou Feliz

Posts: 114
Registered: 7/16/97
Re: How to get the Windows User Name that connect to my IntraWeb server? [Edit]
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 27, 2015 2:57 PM   in response to: Roman Bay in response to: Roman Bay
Tying your web application to Active Directory authentication may also open
you up to purchasing more MS Licensing. As a rule I only use this type of
authentication on intranet application supporting already licensed users.

<Roman Bay> wrote in message news:711760 at forums dot embarcadero dot com...

I need to get the Windows User Name that connect to my IntraWeb server.

I know how to do it in Internet Explorer(with using ActiveXObject). But
this solution does not suit me because ActiveX doesn't work for other
browsers(Chrome or Firefox). Extensions for browsers such as IE-Tab is not
suitable solution.

Maybe somebody knows any other ways or some examples?

Please, help me!

Edited by: Roman Bay on Jan 27, 2015 8:57 AM
Pieter van Wyk

Posts: 8
Registered: 8/2/08
Re: How to get the Windows User Name that connect to my IntraWeb server?
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 28, 2015 7:07 AM   in response to: Roman Bay in response to: Roman Bay
Roman Bay wrote:
I need to get the Windows User Name that connect to my IntraWeb server.

In you ServerController, before creating a new UserSession you can do this

procedure TIWServerController.IWServerControllerBaseNewSession(
  ASession: TIWApplication);
begin
  IWServerController.ServerVariables.Add('AUTH_USER');
  ASession.Data := TIWUserSession.Create(nil, ASession);
end;


and then in your application somewhere you can do this:

UserName := WebApplication.Request.GetServerVariableValue('AUTH_USER');


Edited by: Pieter van Wyk on Jan 28, 2015 7:07 AM
Roman Bay

Posts: 16
Registered: 6/14/13
Re: How to get the Windows User Name that connect to my IntraWeb server?
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 2, 2015 9:29 AM   in response to: Pieter van Wyk in response to: Pieter van Wyk

UserName := WebApplication.Request.GetServerVariableValue('AUTH_USER');


It not work for my case, maybe because I do not use IIS?
Pieter van Wyk

Posts: 8
Registered: 8/2/08
Re: How to get the Windows User Name that connect to my IntraWeb server?
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 9, 2015 6:29 AM   in response to: Roman Bay in response to: Roman Bay
Yes, I think that may be IIS server variables only.

Roman Bay wrote:

UserName := WebApplication.Request.GetServerVariableValue('AUTH_USER');


It not work for my case, maybe because I do not use IIS?
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02