Package com.vaadin.flow.spring.security
Class SpringNavigationAccessControl
java.lang.Object
com.vaadin.flow.server.auth.NavigationAccessControl
com.vaadin.flow.spring.security.SpringNavigationAccessControl
- All Implemented Interfaces:
com.vaadin.flow.router.BeforeEnterListener,com.vaadin.flow.router.internal.BeforeEnterHandler,Serializable
public class SpringNavigationAccessControl
extends com.vaadin.flow.server.auth.NavigationAccessControl
A Spring specific navigation access control that falls back to Spring
mechanisms for user retrieval and role checking, when the generic mechanisms
do not work.
In Spring Boot application, a SpringNavigationAccessControl is
provided by default, but its behavior can be configured by defining a
NavigationAccessControlConfigurer bean.
- See Also:
-
Field Summary
Fields inherited from class com.vaadin.flow.server.auth.NavigationAccessControl
SESSION_STORED_REDIRECT, SESSION_STORED_REDIRECT_ABSOLUTE -
Constructor Summary
ConstructorsConstructorDescriptionCreate a new instance with the default view annotation checker and decision resolver.SpringNavigationAccessControl(Collection<com.vaadin.flow.server.auth.NavigationAccessChecker> checkerList, com.vaadin.flow.server.auth.AccessCheckDecisionResolver decisionResolver) Create a new instance with given checkers and decision resolver. -
Method Summary
Modifier and TypeMethodDescriptionprotected PrincipalgetPrincipal(com.vaadin.flow.server.VaadinRequest request) getRolesChecker(com.vaadin.flow.server.VaadinRequest request) Methods inherited from class com.vaadin.flow.server.auth.NavigationAccessControl
beforeEnter, checkAccess, createNavigationContext, getAccessDeniedException, getLoginUrl, getLoginView, getRequestURL, hasAccessChecker, isEnabled, setEnabled, setLoginView, setLoginView
-
Constructor Details
-
SpringNavigationAccessControl
public SpringNavigationAccessControl()Create a new instance with the default view annotation checker and decision resolver.- See Also:
-
SpringNavigationAccessControl
public SpringNavigationAccessControl(Collection<com.vaadin.flow.server.auth.NavigationAccessChecker> checkerList, com.vaadin.flow.server.auth.AccessCheckDecisionResolver decisionResolver) Create a new instance with given checkers and decision resolver.- Parameters:
checkerList- collection of navigation access checker.decisionResolver- the decision resolver.
-
-
Method Details
-
getPrincipal
- Overrides:
getPrincipalin classcom.vaadin.flow.server.auth.NavigationAccessControl
-
getRolesChecker
- Overrides:
getRolesCheckerin classcom.vaadin.flow.server.auth.NavigationAccessControl
-