Interface VaadinAuthenticationService

All Known Implementing Classes:
StandardAuthenticationService

public interface VaadinAuthenticationService
  • Method Details

    • get

      Returns the VaadinAuthenticationService. This method must be called from a request handling or UI thread.
      Returns:
      the VaadinAuthenticationService
    • get

      static VaadinAuthenticationService get(com.vaadin.flow.component.Component component)
      Returns the VaadinAuthenticationService associated with the UI of the given component.
      Parameters:
      component - any attached component from your UI or the UI itself
      Returns:
      the VaadinAuthenticationService
    • login

      void login(com.vaadin.flow.component.Component commComponent, String username, String password, boolean rememberMe, AuthenticationResultHandler primaryHandler)
      Performs the authentication attempt against Spring Security and call the provided handler with the result.

      The provided commComponent used for communication with the client-side must be enabled. So don't pass in a LoginForm or a Button with "disable on click".

      Parameters:
      commComponent - any component in the login view that will be used for communication with the client-side; the component must be attached and enabled
      username - the user name
      password - the password
      rememberMe - whether remember-me should be used; only has an effect when that feature is actually activated
      primaryHandler - the handler that will be notified first with the result once the login attempt has completed; may be null
    • logout

      default void logout()
      Logs out the current user. This method must be called from a request handling or UI thread.
      See Also:
    • logout

      void logout(com.vaadin.flow.component.Component commComponent)
      Logs out the user associated with the UI of the given component. Affects all UIs in the user's session, not just the provided one.
      Parameters:
      commComponent - any attached component from your UI or the UI itself