UserId - how to find out

H

Helmut Jarausch

Sorry, but I'm a complete newbee!

I need find out under which userid the browser is running.
Is this possible with JavaScript?

Many thanks for a hint,

Helmut Jarausch

Lehrstuhl fuer Numerische Mathematik
RWTH - Aachen University
D 52056 Aachen, Germany
 
M

My Pet Programmer

Helmut Jarausch said:
Sorry, but I'm a complete newbee!

I need find out under which userid the browser is running.
Is this possible with JavaScript?

Many thanks for a hint,

Helmut Jarausch

Lehrstuhl fuer Numerische Mathematik
RWTH - Aachen University
D 52056 Aachen, Germany
If you mean the system user id, as in their Windows logon, can't be done
with JavaScript.
 
H

Helmut Jarausch

Randy said:
My Pet Programmer said the following on 12/27/2007 7:27 AM:

var userID = prompt('What is your user ID?');
You're joking, aren't you?

Then I need to ask for a password, as well. And for that
I need an ssl connection and I have to keep track of user/password
combinations. Not the solution I was after.

Helmut.




--
Helmut Jarausch

Lehrstuhl fuer Numerische Mathematik
RWTH - Aachen University
D 52056 Aachen, Germany
 
M

My Pet Programmer

Helmut Jarausch said:
You're joking, aren't you?

Then I need to ask for a password, as well. And for that
I need an ssl connection and I have to keep track of user/password
combinations. Not the solution I was after.

Helmut.
You could help us help you by extrapolating on your need a bit.
Precisely what username and password are you looking for? Is it system
level, on your site, or something I haven't listed?

~A!
 
T

Tom Rubaj

if you mean the ID of the profile in some dynamic webApplication
(login or nickname) that customizes the output html for each users
(like "Hello Tom, click here to check your account") then there are
basically 2 ways to do it:

1) you can assign the value representing the user while generating the
server response the server-side. Like:

var userId=<%=user.getId() %>;

(that's java jsp the ugly way).
This way, the user's browser will get the code with, say:
var userId=124;

and later on you can use that variable for whatever you please.

2) the never-used-but-theoretically-possible-solution: you can by some
weird way get the user's IP or session ID using javaScript, and query
the server (over ajax, HttpRequest object or something like that) for
the profile corresponding to that data. But no one does it this way,
so I'd suggest (1).

...provided you *do* need some server-side appliaction profile and not
something entirely different
 
H

Helmut Jarausch

Randy said:
Helmut Jarausch said the following on 12/27/2007 9:56 AM:

Not near as much as you want me to be.


Why? You didn't want a password, you wanted the user ID.


What is the user ID going to do for you? And, the username and password
to my desktop won't do anybody any good unless you have access to my
computer. And, that is provided that I even have a username and/or
password.

I need authorization for access to something like a database in a strictly
local network. If I could get access to the user's login password (we are
using Linux exclusively), I can be sure that the user's id has been checked
by the system when that user has logged into the system. So, I don't need
to keep track of an additional (user,password) file, secure connection,
means to change a password, initial passwords, lost passwords and so on.

Many thanks for your help,
Helmut.



--
Helmut Jarausch

Lehrstuhl fuer Numerische Mathematik
RWTH - Aachen University
D 52056 Aachen, Germany
 
T

The Natural Philosopher

Helmut said:
I need authorization for access to something like a database in a strictly
local network. If I could get access to the user's login password (we are
using Linux exclusively), I can be sure that the user's id has been checked
by the system when that user has logged into the system. So, I don't need
to keep track of an additional (user,password) file, secure connection,
means to change a password, initial passwords, lost passwords and so on.

Well if they have logged in via samba, you should be able to pick up
their local IP/userid match from samba log files..assuming a Linux
server. But you need server side scripting for that, assuming the
browser is connecting to the same server for webbery as for file sharing.

I simply set up a server side script that make them login again using
the same Id/password.
 
M

My Pet Programmer

Helmut Jarausch said:
[snip]
I need authorization for access to something like a database in a strictly
local network. If I could get access to the user's login password (we are
using Linux exclusively), I can be sure that the user's id has been checked
by the system when that user has logged into the system. So, I don't need
to keep track of an additional (user,password) file, secure connection,
means to change a password, initial passwords, lost passwords and so on.

You're definitely looking to go server side for that, not much help
JavaScript is going to offer.

Try comp.lang.php

~A!
 
R

RobG

I need authorization for access to something like a database in a strictly
local network. If I could get access to the user's login password (we are
using Linux exclusively), I can be sure that the user's id has been checked
by the system when that user has logged into the system.

No, you can't. All that will tell you is that the user has a valid
local user ID and may not even have a password. You need to control
access at a network level, most likely using LDAP, you don't care
about local access to the PC.
So, I don't need
to keep track of an additional (user,password) file, secure connection,
means to change a password, initial passwords, lost passwords and so on.

Your application doesn't need to track passwords or even user user
IDs, but it must track sessions and integrate with some form of login/
password system. You could put access privileges in the LDAP server
too, but this is completely the wrong place to be discussing that,
they are all server-side technologies, the client just provides a
mechanism for user input.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,061
Latest member
KetonaraKeto

Latest Threads

Top