mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-06 14:20:55 +03:00
add some examples hooks for one time password logins
The examples use Twillo Authy since I use it for my GitHub account. You can easily use other multi factor authentication software in a similar way.
This commit is contained in:
@@ -35,8 +35,8 @@ func exitError() {
|
||||
u := minimalSFTPGoUser{
|
||||
Username: "",
|
||||
}
|
||||
json, _ := json.Marshal(u)
|
||||
fmt.Printf("%v\n", string(json))
|
||||
resp, _ := json.Marshal(u)
|
||||
fmt.Printf("%v\n", string(resp))
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
@@ -52,8 +52,8 @@ func printSuccessResponse(username, homeDir string, uid, gid int) {
|
||||
u.Permissions["/"] = []string{"*"}
|
||||
// uncomment the next line to require publickey+password authentication
|
||||
//u.Filters.DeniedLoginMethods = []string{"publickey", "password", "keyboard-interactive", "publickey+keyboard-interactive"}
|
||||
json, _ := json.Marshal(u)
|
||||
fmt.Printf("%v\n", string(json))
|
||||
resp, _ := json.Marshal(u)
|
||||
fmt.Printf("%v\n", string(resp))
|
||||
os.Exit(0)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user