> -----Original Message-----
> From: django-users@googlegroups.com 
> [mailto:[EMAIL PROTECTED] On Behalf Of PeteDK
> Sent: 21 August 2008 11:14
> To: Django users
> Subject: Re: how to locate the OS currently logged in user??
> 
> 
> > Have you tested the suggestion above with someone who is not sshed 
> > into the box, because if it is just the remote user of the app you 
> > want, you really don't want to be doing '/usr/bin/ who' 
> because that 
> > will return the users sshed onto the box (and *not* the 
> users logged 
> > into the web app via your authentication system!).
> >
> > I am basically doing what you are (authenticating against 
> LDAP), and 
> > the way you can access the remote user is 
> request.META['AUTHENTICATE_UID'].
> > I am not even using the django auth.User stuff for basic 
> web app usage 
> > (since the user must be authenticated already, I just look 
> to see who 
> > they are), only for the admin stuff. Only a very small number of 
> > people will be using the admin site so I am not to bothered 
> about them 
> > having to log in again (although if there is an easy way of passing 
> > credentials across I could use that!).
> >
> > HTH,
> > Emily
> 
> Hey. I haven't had a chance of testing it yet but it sounds 
> like your method is the one i am looking for :) The thing is, 
> i am not very good with server stuff (i am sure you have 
> figured this out already) ;-) But as i wrote in my last post. 
> The user logs onto the server using the username and password 
> stored in the active directory. This is required before they 
> can access anything on the server.
> 
> After they pass the login they are redirected to my django 
> app, where i would like to avoid having them to log in again.
> so all i really need is the username of the user logging in 
> to the server, so that i can (in the background) log them in 
> to the django app.
> 
> When it comes to the admin part of my django app they will 
> have to use a separate username and password. This is not a 
> problem however since this will be 2 or 3 users at the most.
> 
> I hope this made it more clear? :-)
> 
> but Emily??
> Do you think your method will work on debian linux, and do i 
> need to import something extra in order to get it to work?

I am not very technical either, so I am not entirely sure, but it doesn't
sound like an OS thing, it sounds like a webserver configuration thing. If
you have used PHP with apache before it is lke doing
$_SERVER['REMOTE_USER'].

When you say "The user logs onto the server", do you mean that users point
their browser at a url and a username / password box pops up saying
something like "A user name and password are being requested by
http://blah.com.";?

If the box is set up so that you have to authenticate to view the web pages,
then I would imagine it will work. The webserver will know who the remote
user is because they have authenticated (otherwise they would not be allowed
on), so it is just a matter of accessing this, and the data will be
somewhere in the request object. It is just a matter of finding it.

I think what I did to figure out how to get the user, was something like
logging.debug(vars(request.META)) (in my view), got a couple of people in my
office a link to my webapp, and hunted around from there.

To use logging.debug you need to do this:

import logging
logging.basicConfig(
    level = logging.DEBUG,
    format = '%(asctime)s %(levelname)s %(message)s',
)


If you are still stuck it is worth asking the person who set up the web
server to give you more details about it, and find out how the django server
is started (and let us know).

Em :)



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to