private void login(final String tenant, final String user, final String password, final boolean setCookies) { try { if (multiTenancyIndicator.isMultiTenancySupported()) { vaadinSecurity.login(new TenantUserPasswordAuthenticationToken(tenant, user, password)); } else { vaadinSecurity.login(new UsernamePasswordAuthenticationToken(user, password)); } /* set success login cookies */ if (setCookies && useCookie) { setCookies(); } } catch (final CredentialsExpiredException e) { LOG.debug("Credential expired", e); loginCredentialsExpiredNotification(); } catch (final AuthenticationException e) { LOG.debug("Authentication failed", e); /* if not successful */ loginAuthenticationFailedNotification(); } catch (final Exception e) { LOG.debug("Login failed", e); loginAuthenticationFailedNotification(); } }
private void login(final String tenant, final String user, final String password, final boolean setCookies) { try { if (multiTenancyIndicator.isMultiTenancySupported()) { vaadinSecurity.login(new TenantUserPasswordAuthenticationToken(tenant, user, password)); } else { vaadinSecurity.login(new UsernamePasswordAuthenticationToken(user, password)); } /* set success login cookies */ if (setCookies && useCookie) { setCookies(); } } catch (final CredentialsExpiredException e) { LOG.debug("Credential expired", e); loginCredentialsExpiredNotification(); } catch (final AuthenticationException e) { LOG.debug("Authentication failed", e); /* if not successful */ loginAuthenticationFailedNotification(); } catch (final Exception e) { LOG.debug("Login failed", e); loginAuthenticationFailedNotification(); } }