Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Intranet - Get User ID from AD

by RHC_ICT (Initiate)
on Nov 19, 2021 at 16:52 UTC ( [id://11138948]=perlquestion: print w/replies, xml ) Need Help??

RHC_ICT has asked for the wisdom of the Perl Monks concerning the following question:

Hi We are using Perl to display some Intranet pages (web browser). The user is logged into their computer and on the domain. We would like to get the user ID of the active user on the web page. i.e. john.kilo We know the Perl basics but not sure where to start on this as the web session runs under anonymous IUSR and can't find anything under google. Using Strawberry Perl under Windows. Thank you

Replies are listed 'Best First'.
Re: Intranet - Get User ID from AD
by NERDVANA (Deacon) on Nov 20, 2021 at 14:51 UTC
    I have some brief exposure to this problem, so I might not be able to give you all the answers, but can at least give some hints on where to look.

    One of our customers wanted to authenticate users based on active directory, and we found that web browsers and web servers each usually have a "gssapi" plugin that can do the authentication based on current windows user. What we ended up doing was installing the gssapi plugin for apache, then doing a bunch of awkward kerberos ticket things for the linux server than ran apache, then have the gssapi plugin handle the entire http auth sequence and then hand a header to the perl app, So the perl app never needed to talk to active directory, it just reads a header in the request to know who is authenticated. (and be sure to configure apache to not allow that header to be supplied by the client!)

    One disadvantage of that method is because it is HTTP auth, there is no way to log out. If they are logged in on the desktop they have access and if not they don't. If you wanted to control it from Perl, you would need to handle the http auth handshake on your own, using a plugin for whatever web framework you use, if one exists.

    I'm also not sure if it is possible to get the browser to report the username without going through the full auth sequence.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://11138948]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (3)
As of 2024-04-19 01:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found