Interface VaadinAuthenticationService
-
- All Known Implementing Classes:
StandardAuthenticationService
public interface VaadinAuthenticationService
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description static VaadinAuthenticationServiceget()Returns theVaadinAuthenticationService.static VaadinAuthenticationServiceget(com.vaadin.flow.component.Component component)Returns theVaadinAuthenticationServiceassociated with the UI of the given component.voidlogin(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.default voidlogout()Logs out the current user.voidlogout(com.vaadin.flow.component.Component commComponent)Logs out the user associated with the UI of the given component.
-
-
-
Method Detail
-
get
static VaadinAuthenticationService get()
Returns theVaadinAuthenticationService. 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 theVaadinAuthenticationServiceassociated 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
commComponentused for communication with the client-side must be enabled. So don't pass in aLoginFormor aButtonwith "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 enabledusername- the user namepassword- the passwordrememberMe- whether remember-me should be used; only has an effect when that feature is actually activatedprimaryHandler- 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(Component)
-
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
-
-