473,732 Members | 2,205 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to get the username, without login prompt?

I am posting this for the lack of a better newsgroup, and for the
knowledge of people here, and because its only partially OT.

We have a bunch of users with their computers at work. There are
reports that the users need, which could be in html, php, asp, jsp,
whatever.

Now I am trying to eliminate the login window entirely. In an html
request, the client (firefox, ie, etc) sends the clients hostname, IP,
a bunch of other stuff, but never the username. If the server-side
scripts could know which user is logged in, it could display only the
reports that user has access to. Ideally the process should work
across browsers... else I could compile firefox to send the username
in the header somewhere...

So I ask all the skilled developers here, this intriguing question.
How do you pass the username to the server without the login prompt???

Ideas:
(1) A fixed cookie
(2) ActiveX somehow.
(3) An applet is loaded that somehow gets the username, and the page
redirects in 1 sec, sending the username to the server.
(4) Firefox compiled to somewhere in the header include the username
(5) An initial page that runs an applet or something, that puts the
username into a cookie, and the page redirects in 1 sec, sending the
cookie
Is there any programming language, api, COM (Activex? applets?) or
other method to do this cleanly??

will it work if I exclusively use IIS and IE instead of firefox and
apache?
Jul 17 '05 #1
11 4869
Ghazan Haider wrote:
I am posting this for the lack of a better newsgroup, and for the
knowledge of people here, and because its only partially OT.

We have a bunch of users with their computers at work. There are
reports that the users need, which could be in html, php, asp, jsp,
whatever.

Now I am trying to eliminate the login window entirely. In an html
request, the client (firefox, ie, etc) sends the clients hostname, IP,
a bunch of other stuff, but never the username. If the server-side
scripts could know which user is logged in, it could display only the
reports that user has access to. Ideally the process should work
across browsers... else I could compile firefox to send the username
in the header somewhere...

So I ask all the skilled developers here, this intriguing question.
How do you pass the username to the server without the login prompt???

Ideas:
(1) A fixed cookie
(2) ActiveX somehow.
(3) An applet is loaded that somehow gets the username, and the page
redirects in 1 sec, sending the username to the server.
(4) Firefox compiled to somewhere in the header include the username
(5) An initial page that runs an applet or something, that puts the
username into a cookie, and the page redirects in 1 sec, sending the
cookie
Is there any programming language, api, COM (Activex? applets?) or
other method to do this cleanly??

will it work if I exclusively use IIS and IE instead of firefox and
apache?


Quick couple of questions before I ponder.

1) Is this an internal network (192.168) style
2) Straight in access from any IP connection ie visible from the web or
intranet ?
3) Roaming logins in that a user a may login from any machine or is user
fixed to one specific machine and hence a fixed internal IP ?
Jul 17 '05 #2
NSpam wrote:
Ghazan Haider wrote:
I am posting this for the lack of a better newsgroup, and for the
knowledge of people here, and because its only partially OT.

We have a bunch of users with their computers at work. There are
reports that the users need, which could be in html, php, asp, jsp,
whatever.

Now I am trying to eliminate the login window entirely. In an html
request, the client (firefox, ie, etc) sends the clients hostname, IP,
a bunch of other stuff, but never the username. If the server-side
scripts could know which user is logged in, it could display only the
reports that user has access to. Ideally the process should work
across browsers... else I could compile firefox to send the username
in the header somewhere...

So I ask all the skilled developers here, this intriguing question.
How do you pass the username to the server without the login prompt???

Ideas:
(1) A fixed cookie
(2) ActiveX somehow.
(3) An applet is loaded that somehow gets the username, and the page
redirects in 1 sec, sending the username to the server.
(4) Firefox compiled to somewhere in the header include the username
(5) An initial page that runs an applet or something, that puts the
username into a cookie, and the page redirects in 1 sec, sending the
cookie
Is there any programming language, api, COM (Activex? applets?) or
other method to do this cleanly??

will it work if I exclusively use IIS and IE instead of firefox and
apache?

Quick couple of questions before I ponder.

1) Is this an internal network (192.168) style
2) Straight in access from any IP connection ie visible from the web or
intranet ?
3) Roaming logins in that a user a may login from any machine or is user
fixed to one specific machine and hence a fixed internal IP ?


Oh and by are client machines running Windows or Linux. If Windows and
we are talking PHP based web pages it should be possible to get the
windows user id/password via the PHP win32 api. Can't speak for Perl. I
don't know if this would answer as you may have different login
requirements for different reporting engines.
Jul 17 '05 #3
> 1) Is this an internal network (192.168) style

Yes... it shouldnt matter though. Would like the flexibility of the
Internet too.
2) Straight in access from any IP connection ie visible from the web or
intranet ?
Currently yes, but if we go Internet, it'll probably pass through an
openbsd firewall. Once again, currently I'll take anything.
3) Roaming logins in that a user a may login from any machine or is user
fixed to one specific machine and hence a fixed internal IP ?


A user may login from any machine.

I thought of cookies on each machine or authenticating by IP. Bad
idea, we have DHCP and IPs have gotten shuffled around (maybe
hostnames, but those change too). I thought of login batch files that
create the cookies, which contain usernames. That gets pretty close.
Anything along the lines of COM or ActiveX should be cleaner, if they
can scoop up usernames from the client to put into a query, link or
form. Not having to touch each machine would be one step forward,
browser independence would be another.

All machines however are win32. The win32 API couldnt work since they
interface with the server's DLLs, I'm at pains to wonder how they
could touch a client's DLLs or windows outside of COM, .NET or
activex...

Any ideas how to get the username without touching each machine, or
without login scripts or recompiling firefox?
Jul 17 '05 #4
Ghazan Haider wrote:
I am posting this for the lack of a better newsgroup, and for the
knowledge of people here, and because its only partially OT.

We have a bunch of users with their computers at work. There are
reports that the users need, which could be in html, php, asp, jsp,
whatever.

Now I am trying to eliminate the login window entirely. In an html
request, the client (firefox, ie, etc) sends the clients hostname, IP, a bunch of other stuff, but never the username. If the server-side
scripts could know which user is logged in, it could display only the
reports that user has access to. Ideally the process should work
across browsers... else I could compile firefox to send the username
in the header somewhere...

So I ask all the skilled developers here, this intriguing question.
How do you pass the username to the server without the login prompt???
Ideas:
(1) A fixed cookie
(2) ActiveX somehow.
(3) An applet is loaded that somehow gets the username, and the page
redirects in 1 sec, sending the username to the server.
(4) Firefox compiled to somewhere in the header include the username
(5) An initial page that runs an applet or something, that puts the
username into a cookie, and the page redirects in 1 sec, sending the
cookie
Is there any programming language, api, COM (Activex? applets?) or
other method to do this cleanly??

will it work if I exclusively use IIS and IE instead of firefox and
apache?

If you use IIS and IE, there is a setting in IIS... under "Directory
Security"... to disable Anonymous access and turn on "Integrated
Windows Authentication" .

When this is enabled, IIS will talk to IE using a proprietary
challenge-response protocol to determine the username without the user
having to type it in. Within PHP then, $_SERVER["AUTH_TYPE"] will say
"Negotiate" and the username will appear in $_SERVER["AUTH_USER"],
$_SERVER["LOGON_USER "] and $_SERVER["REMOTE_USE R"]. I'm not sure what
the difference between the three are.

As per: http://adam.theficus.com/archives/20...x_tutoria.html
Firefox can also be setup to do transparent NTLM authentication, by
twiddling a config setting.
I've also set something up before within a LAN to do transparent
username identification to Apache ( similar to your ideas 2 & 3 ), but
the browser must be IE, and you need to be able to control the IE
security settings to allow the scripting of ActiveX Controls. Also
note that while this allows you to get the username transparently, it
offers basically NO security. A mildly tech-saavy user could certainly
spoof their username.

<SCRIPT LANGUAGE="JavaS cript">
<!--
// Set wshShell
function GetTheId() {
var wshShell = new ActiveXObject(" WScript.Shell") ;

// Pull Environment variables for domain\user
domain = wshShell.Expand EnvironmentStri ngs("%USERDOMAI N%");
userName = wshShell.Expand EnvironmentStri ngs("%USERNAME% ");

document.all.it em('username'). value = userName;
document.all.it em('domain').va lue = domain;
document.all.it em('GetUserId') .submit();
//-->
}
</SCRIPT>
<body onLoad="GetTheI d();">

<form name="GetUserId " method="post" action="/login/refreshpage.php ">
<input type="hidden" name="username" value="">
<input type="hidden" name="domaind" value="">
<input type="hidden" name="action" value="<?=$acti on;?>">
</form>
Gathering your User Info.<br>Please wait.<br><br>
If it fails to continue, please click <a
href="/login/manuallogin.php ">here</a> to login.<br>
</body>

Jul 17 '05 #5
Thanks Ramius, that helped lots.

I think I'll just go with IIS, since we've been trying to push out
firefox for everyone. I dont really care about high levels of
security, just identifying the users, so this will work for me, with a
little config change of firefox.
Jul 17 '05 #6
In: <1a************ *************@p osting.google.c om>, gh***********@g mail.com (Ghazan Haider) wrote:
We have a bunch of users with their computers at work. There are
reports that the users need, which could be in html, php, asp, jsp,
whatever. So I ask all the skilled developers here, this intriguing question.
How do you pass the username to the server without the login prompt???


Anyone trying to do this with apache might have a look at:

http://httpd.apache.org/docs-2.1/mod/mod_ident.html

It should get you the username in an open standard sort of way. I wouldn't
rely on it for high security, but it is an open standard, simple approach
for obtaining just the username. Has the advantage of being cross platform,
disadvantage is that it is possible, nearly trivial, to forge identd.

For higher security, you might try:

http://httpd.apache.org/docs-2.1/mod/mod_ssl.html looks promising (I've heard
of high security applications using it, though I personally haven't, too much
overhead for any of my projects thus far) Using client certificates was said to
be the most secure authentication available. Also the most overhead, seems to
me it would be tied to the browser, not the person.

Yea, I know.. SSL is usually thought of as a way to send data securely, not
authentication. . I've been told it can do both, so I keep it in my category of
possibly/maybe solutions to problems encountered possibly/maybe some day.

Jamie
--
http://www.geniegate.com Custom web programming
gu******@lnubb. pbz (rot13) User Management Solutions
Jul 17 '05 #7
They both look promising... I couldnt find an indentd service/daemon
in my XP client. Might still work since ident is standard.

I'm not looking for high security at all, just default identification
of windows domain usernames, from default windows2000/xp
installations. I've several options here now, you added two. Will
investigate further...
Jul 17 '05 #8
Hi Ramiu

I have a similiar problem: I need to know the local IP / MAC adress o
the client from which the user logs on, as the configuration of som
applications is dependent on the HW configuration (peripherals). th
usual remote_addr thing does not work, as client in intranet o
internet (remote from home), webserver from where the applicatio
runs is internet (1 client W98, all other XP, all IE)

In a lot of js forums / docs I found statements that I can get ip
mac with js / activex, but no reasonable info on how to. (wha
happens on a notebook with LAN/WLAN nic?
can you help
thanks
trombon
http://eye.cc -php- web design
Jul 17 '05 #9
trombone wrote:
Hi Ramius

I have a similiar problem: I need to know the local IP / MAC adress of
the client from which the user logs on, as the configuration of some
applications is dependent on the HW configuration (peripherals). the
usual remote_addr thing does not work, as client in intranet or
internet (remote from home), webserver from where the application
runs is internet (1 client W98, all other XP, all IE).

In a lot of js forums / docs I found statements that I can get ip /
mac with js / activex, but no reasonable info on how to. (what
happens on a notebook with LAN/WLAN nic?)
can you help?
thanks
trombone
http://eye.cc -php- web design


Trombone,

You can't get my local IP address with PHP - PHP is service side, and my
system is behind a firewall (using NAT). Nothing on the Internet side of
the firewall knows my system's address; all they know is the firewall's.

Additionally, you know nothing about what's connected to my machine -
that would be a very severe security violation. For instance, can you
imagine if any website you visited could find out what was connected to
your local machine?

Since these are all IE/Windows, you might be able to do something with
ActiveX controls - get the info you need with the control and send it
into your web page. The same might be true with Javascript. It all
depends on the exact details you need (and the security settings on the
user's system).

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
Jul 17 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
4578
by: VJ | last post by:
Hi, IIS raises login dialog box prompt on browser for resources protected using basic authentication. That login prompt gives user 3 attempts to enter correct userid/password. IIS throw 401.1 error if third attempt fails. Does anyone know how to change this number of attempts. Is it possible or impossible to do ? Thanks
0
1939
by: Meral Agceli via .NET 247 | last post by:
A crystal report is developed using Crystal 8.5 and a trustedconnection to a SQL Server database. I'm trying to display thisreport in Crystal Report Viewer using VB.NET. When theapplication is run, I get the Login prompt every time. I want tostop this from happening by setting this within the code. I canget it to work when the report is developed with a secureconnection (username/password). I can also get it to work whenthe report is developed...
2
2908
by: pv | last post by:
Hi everyone, I need help with following scenario, please: Users are accessing same web server from intranet (users previously authenticated in Active Dir) and from extranet (common public users). If user is from intranet, web server should recognize it and application should create additional options in controls regarding groups the user belongs to. If user is from extranet it should be logged in as anonymous and a link to login page...
1
3275
by: CBKowitz | last post by:
I have an intermittent problem, when viewing a crystal report. This problem only happens to some users and some report formats. When they try to view the report in Microsoft Word format the system prompts them to login (User name and Password). If they view it in PDF format they do not get the login prompt. I do not get the login prompt at all. This problem occurs with users on the Internet and our Intranet. I checked the web site and...
3
7133
by: ad | last post by:
I have create a custom membership provider. The common usage of custom membership is set it as default Membership Provider win web.config, and use login controls with it. How can I use custom membership provider without Login Controls? For example, the name of my custom membership provider MyMembershipProvider. Is the codes below right? MyMembershipProvider myProvider=new MyMembershipProvider();
4
6656
by: Luqman | last post by:
How can I Prevent user from accessing any page directly without Login ? User should not be able to by pass the Login screen by typing the Url of any page directly. I am using ASP.Net 2.0 with Visual Studio 2005. Best Regards, Luqman
2
2925
samycbe
by: samycbe | last post by:
Hi, I want to open a file from javascript with the code, window.open("file://///xxxxxxxx/xxxx/xx/freedom.exe"). It is opening preperly. But asking the prompt for open,save and cancel. I want to run the file without the prompt. Please help me. samy
0
1201
by: srirampavan | last post by:
how to get login prompt window when we press radio button??/
0
8946
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8774
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9307
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9181
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6735
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6031
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4809
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3261
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2180
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.