Add Google Authenticator PAM module for 2FA
Google authenticator PAM module enables two-factor authentication for
logging in to servers. It provides both HMAC-based and Time-based OTPs
as the second factor on top of usual password authentication.
This commit adds a new distro feature for google authenticator and can
be enabled or disabled for any machine based on the requirement.
Tested By:
* Built openbmc for p10bmc
* Verified that the google-authenticator was pulled and the binary is
installed
Change-Id: I586715a924eddd90c9cb6f967db35824767330ca
Signed-off-by: Asmitha Karunanithi <asmitk01@in.ibm.com>
diff --git a/meta-phosphor/conf/distro/include/google-authenticator-libpam.inc b/meta-phosphor/conf/distro/include/google-authenticator-libpam.inc
new file mode 100644
index 0000000..9b023c4
--- /dev/null
+++ b/meta-phosphor/conf/distro/include/google-authenticator-libpam.inc
@@ -0,0 +1,2 @@
+DISTRO_FEATURES += "google-authenticator-libpam"
+DISTROOVERRIDES .= ":df-google-authenticator-libpam"
diff --git a/meta-phosphor/recipes-phosphor/users/phosphor-user-manager_git.bb b/meta-phosphor/recipes-phosphor/users/phosphor-user-manager_git.bb
index d821ebc..b7d9c0f 100644
--- a/meta-phosphor/recipes-phosphor/users/phosphor-user-manager_git.bb
+++ b/meta-phosphor/recipes-phosphor/users/phosphor-user-manager_git.bb
@@ -43,6 +43,7 @@
"
USERADD_PACKAGES = "${PN} phosphor-ldap"
+RDEPENDS:${PN}:append:df-google-authenticator-libpam = " pam-google-authenticator google-authenticator-libpam"
PACKAGE_BEFORE_PN = "phosphor-ldap"
DBUS_PACKAGES = "${USERADD_PACKAGES}"