public void onClick(ClickEvent event) {
DeferredCommand.addCommand(new Command() {
public void execute() {
Registry.get(SecurityService.class).doAuthentication(
new AuthenticationHandler() {
public void doLogin(Credential[] credentials) {
for (Credential c : credentials) {
if (c instanceof NameCredential) {
((NameCredential) c).setName(display.getUsernameInput().getText());
} else if (c instanceof PasswordCredential) {