[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Basic Authentication for web pages

On Tue, 2 Feb 1999, Wes Brown wrote:

> I have been looking into creating an application that will use PAM as the
> authentication mechanism for Basic Authentication of web pages.
> I have the code to get the information from the server.  Now I am trying to
> figure out how the PAM library is going to know where to get the 
> password.
> hoping for Kerberos IV and 5, Novell bindery, and local passwd file access.

You can use "nwauth" (part of ncpfs package) to authenticate to a Novell
server. Currently only bindery authentication is available. Here's a
(simple) function (in PHP) that return 0 or 1 based on bindery

function nwauth ($nwserver, $user, $pass) {
  $command=sprintf("echo \"%s\" | nwauth -S %s -U %s",  // parsing the
                    $pass, $nwserver, $user);          // command
    $out = array();                           // Just a dummy variable
    exec($command,$out,$auth);                // *THE* meat!
    if ($m_auth<>0){
      return 0; // failed authentication
    } else {
      return 1; // passed

You can call the function against one Novell server and if it fails call
it against another one (just in case).

Note that $pass as returned by basic authentication *may* contain trailing
'\n'. In which case you are going to have to 'chop()' it.


|  The nice thing about Windows is - It does not just crash,            |
|              it displays a dialog box and lets you press 'OK' first.  |
|                            Hossein S. Zadeh                           |
|                         hossein@bf.rmit.edu.au                        |
| Dept of Aerospace Engineering    | RMIT-Faculty of Business           |
|  (YES! I AM a rocket scientist!!)|    (YES! I AM in business!!)       |
|                                                                       |
| Royal Melbourne Institute of Technology (RMIT), Melbourne, Australia  |

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index] []