Ensure user information is available in KeyboardInteractive callback

Fixes #116
This commit is contained in:
xf0rk 2019-07-11 11:00:05 -07:00 committed by Kaleb Elwert
parent 5b6cc7030f
commit 866d0ddf79

@ -130,6 +130,7 @@ func (srv *Server) config(ctx Context) *gossh.ServerConfig {
}
if srv.KeyboardInteractiveHandler != nil {
config.KeyboardInteractiveCallback = func(conn gossh.ConnMetadata, challenger gossh.KeyboardInteractiveChallenge) (*gossh.Permissions, error) {
applyConnMetadata(ctx, conn)
if ok := srv.KeyboardInteractiveHandler(ctx, challenger); !ok {
return ctx.Permissions().Permissions, fmt.Errorf("permission denied")
}