Monks,

Does anyone know of any Perl-mechanisms for doing relatively cross platform (and somewhat pluggable) authentication? Admittedly, this is a pipe dream, but it would be gold if it exists. I see tools such as some starting with Authen and some plugins from OpenThought (but those appear to be only partially completed).

Example API's I would like to call from a daemon running as root:

validateUser($user,$pass) -> 1 or 0 validateUserInGroup($user,$pass,$group) -> 1 or 0

Ideally I would like to support ActiveDirectory, LDAP, and so on... but at a bare minimum support for local Windows passwords and local Linux passwords (/etc/passwd) would be a start. I don't need to use foreign authentication systems (aka Unix boxen don't need to know how to check ActiveDirectory), I just need to authenticate with whatever mechanisms are available on the box. Unfortunately, we aren't only supporting Linux, so I can't use PAM and be done with it. Ah, wouldn't THAT be nice :)

Why I'm asking -- well, I need to retrofit some authentication into a Java (ack! run away!) app. Hand-rolled authentication systems are not acceptable per requirements. The logical choice (just using JAAS -- since this is a Java daemon) does not support anything but checking the current user's permissions, so that doesn't meet my requirements of logging in with a username and password for any user. The JAAS folks did a good job of making a tool that doesn't do much, essentially.

Calling out to Perl on the server-side is an admitted hack, but it seems to be a good short-term solution. Writing tons of C++ code and calling JNI (the endorsed way) isn't *that* much better that shelling out to Perl, given logins will not be attempted often. Overhead will be minimal. Plus, if this bails us out, it's bonus points for Perl in the organization.

Any ideas?


In reply to Cross-Platform Pluggable Authentication & Authorization by flyingmoose

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.