One simple way would be to use the LoginForm add on.
https://vaadin.com/directory#addon/loginform
The other way would be to just display a form with login&password fields and set the Login button as the default action.
In Vaadin 7:
// Have an Login button and set it as the default button
Button login = new Button("Login");
login.setClickShortcut(ShortcutAction.KeyCode.ENTER); // Bind ENTER key to this button.
login.addStyleName(Reindeer.BUTTON_DEFAULT); // Add styling as visual cue this button is the default button (has Enter key bound to it).
Vaadin 8 uses a different theme by default, Valo instead of Reindeer, using a different style name:
// Have an Login button and set it as the default button
Button login = new Button("Login");
login.setClickShortcut(ShortcutAction.KeyCode.ENTER); // Bind ENTER key to this button.
login.addStyleName(ValoTheme.BUTTON_PRIMARY); // Add styling as visual cue this button is the default button (has Enter key bound to it).
See documentation on Shortcut Keys for Vaadin 7 and for Vaadin 8. Note that some web browsers may not support some keyboard shortcuts.