Write your Authorization scripts/programs to any language you are familiar
Forth, Erlang, Lisp, Fortran, Perl, C, etc

You must always pass the three arguments

    1)  username    (packed as hex strings to avoid shell attacks)
    2)  password    (packed as hex strings to avoid shell attacks)
    3)  list of comma delimitted groups where user should be member at least to one of them

    e.g  foo  726f6f74 70617373776f7264 group1,group2,group3

As result script must print at standard output the three lines

    1 if the login is succesfull , or 0 if the login failed
    a message, usually an excuse why the login failed
    a comma delimitted list the groups user is member of the specified ones
       
For hex packed string you could do
string to hex

  perl -e "print unpack('H*', \$ARGV[0]),\"\n\""  Joe
  echo -n Joe | xxd -ps
  echo -n Joe | od -A n -t x1 |sed 's/ //g'

hex to string

  perl -e "print pack('H*', \$ARGV[0]),\"\n\""  4a6f65
  echo -n 4a6f65 | xxd -r -ps
  
Can it be any simpler ?
Wish you happy coding

George Mpouras
george.mpouras@yandex.com