Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

What is your webserver and OS? Maybe you could use the webserver's authentication to log on, then create an ActiveDirectory group of users who are allowed to log on.

If not, I'd recommend ADSI over LDAP (only works with Windows servers). If the AD consists of only one domain, LDAP will work fine; but if there are several domains, with LDAP you'll need to know to use one server for each domain. But with ADSI, you can first search the Global Catalog for the samAccountName or userPrincipalName, and then use the user's ADsPath to bind to the AD and authenticate the user.

If you have to use Net::LDAP, it is safer to use Version2 for writing and searching because AD normally doesn't use utf8 but iso-latin-1 as encoding; and if you want to search or write non-ascii-chars like umlauts, you will get problems with Ldap-Version3)

Update: with ADSI and some AD configurations, there exists a security feature/problem that the explicit logon to the AD doesn't work and is silently converted to the user which runs the script on the webserver. I don't know the name of this option, but usually find it out by trying to log on as a different user and then manually check the event-security log of the AD-Domaincontroller once to see if I can do such a log on. But there must be a better solution to find out which user is currently logged on on the AD via ADSI

Best regards,
perl -e "s>>*F>e=>y)\*martinF)stronat)=>print,print v8.8.8.32.11.32"


In reply to Re: Authenticate Active Directory by strat
in thread Authenticate Active Directory by SteveS832001

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2024-04-18 09:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found