mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-06 22:30:56 +03:00
add builtin two-factor auth support
The builtin two-factor authentication is based on time-based one time passwords (RFC 6238) which works with Authy, Google Authenticator and other compatible apps.
This commit is contained in:
@@ -217,6 +217,7 @@ func TestMain(m *testing.M) {
|
||||
logger.ErrorToConsole("error writing keyboard interactive script: %v", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
sftpdConf.KeyboardInteractiveAuthentication = true
|
||||
sftpdConf.KeyboardInteractiveHook = keyIntAuthPath
|
||||
|
||||
createInitialFiles(scriptArgs)
|
||||
@@ -333,6 +334,7 @@ func TestInitialization(t *testing.T) {
|
||||
sftpdConf.EnabledSSHCommands = append(sftpdConf.EnabledSSHCommands, "ls")
|
||||
err = sftpdConf.Initialize(configDir)
|
||||
assert.Error(t, err)
|
||||
sftpdConf.KeyboardInteractiveAuthentication = true
|
||||
sftpdConf.KeyboardInteractiveHook = "invalid_file"
|
||||
err = sftpdConf.Initialize(configDir)
|
||||
assert.Error(t, err)
|
||||
|
||||
Reference in New Issue
Block a user