### Navigation

- index
- modules |
- next |
- previous |
- Gate One Documentation »
- Developer Documentation »

# `authpam.py` - A PAM Authentication Module

This authentication module is built on top of python-pam (or PAM). The latest version of which can be found here: ftp://ftp.pangalactic.org/pub/tummy/ or if that doesn't work try: http://packages.debian.org/lenny/python-pam

It was originally written by Alan Schmitz.

The only non-obvious aspect of this module is that the pam_realm setting is only used when the user is asked to authenticate and when the user's information is stored in the 'users' directory. It isn't actually used in any part of the authentication (PAM doesn't take a "realm" setting).

class `authpam.``PAMAuthMixin`(application, request, **kwargs)

  This is used by PAMAuthHandler in auth.py to authenticate users via PAM.

  `initialize`()

    Print out helpful error messages if the requisite settings aren't configured.

  `get_authenticated_user`(callback)

    Processes the client's Authorization header and call self.auth_basic()

  `auth_basic`(auth_header, callback)

    Perform Basic authentication using self.settings['pam_realm'].

  `authenticate_redirect`()

    Informs the browser that this resource requires authentication (status code 401) which should prompt the browser to reply with credentials.

    The browser will be informed that we support Basic auth.

### Navigation

- index
- modules |
- next |
- previous |
- Gate One Documentation »
- Developer Documentation »