ghidra/Ghidra/RuntimeScripts/Common/server/jaas/jaas_external_program.example.sh
dev747368 a62730477e GT-2658 GhidraServer authentication via JAAS
Add JAAS auth mode -a4.
Supply some example JAAS config files.
2019-09-03 12:23:51 -04:00

28 lines
669 B
Bash
Executable file

#!/bin/bash
# This is a trivial example to show how the Ghidra ExternalProgramLoginModule
# communicates with the external authenticator.
#
# The username and password will be supplied on STDIN separated by a newline.
# No other data will be sent on STDIN.
#
# The external authenticator (this script) needs to exit with 0 (zero) error level
# if the authentication was successful, or a non-zero error level if not successful.
#
echo "Starting example JAAS external auth script" 1>&2
read NAME
read PASSWORD
if [[ ${NAME} =~ "bad" ]]
then
echo "Login failed: username has 'bad' in it: $NAME" 1>&2
exit 100
else
echo "OK"
fi
echo "Returning from script" 1>&2