MyNixOS website logo
Description

Haskell binding for C PAM API.

This package provides PAM interface for Haskell programs. See the README on GitHub at see the README on GitHub at <https://github.com/oscar-h64/pam-haskell#readme for more information.

pam

Haskell CI Hackage

Haskell bindings for PAM. Note that this does not currently include the required bindings to write PAM modules

Usage:

To authenticate a user test using the system-local-login PAM configuration:

authenticate "system-local-login" "test" "PASSWORD"

To check if a user test exists using the system-auth PAM configuration:

checkAccount "system-auth" "test"

If the operation was successful then PamSuccess will be returned, otherwise PamCode a, where a represents the reason for the failure.

pamCodeToMessage, pamCodeToCDefine and pamCodeDetails can be used to get further details about the response, and isSuccess can be used to check if the operation was successful. See the Haddock documentation for more details on these functions.

Documentation:

The documentation is available on Hackage

Changes in v0.2.0.0:

  • authenticate function now returns MonadIO m => m PamRetCode rather than IO (Either Int ())
  • authSuccess :: PamRetCode -> Bool added which checks if the given PamRetCode is PamSuccess or not
  • whenSuccess :: MonadIO m => PamRetCode -> m PamRetCode -> m PamRetCode added, which returns the second argument if the given response code is PamSuccess, otherwise it returns the given response code (useful for continuing only if the PAM action succeeded).
  • pamCodeToMessage, pamCodeToCDefine and pamCodeDetails now take a PamRetCode rather than an Int
  • checkAccount function has now been implemented

Planned Changes:

  • Document and refactoring the code (started)
  • Add ability to give multiple passwords (for 2FA systems) (see #2)
  • Add functions that do the prompting rather than being given details - useful as if a program using the library is intended to be distributed the number of prompts will not be known (see #3)
  • Add functions to allow writing PAM modules in Haskell (see #8)

Contributing:

See here for more information.

Metadata

Version

0.2.0.0

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows