com.vaadin.flow.server.auth.

Class ViewAccessChecker

    • Field Detail

      • SESSION_STORED_REDIRECT

        public static final String SESSION_STORED_REDIRECT
    • Constructor Detail

      • ViewAccessChecker

        public ViewAccessChecker()

        Create an instance.

      • ViewAccessChecker

        protected ViewAccessChecker(AccessAnnotationChecker accessAnnotationChecker)

        Creates an instance using the given checker.

        Note that the access checker is disabled by default and can be enabled using enable(). You should also set the login view to use using setLoginView(Class) or setLoginView(String)

        Parameters:

        accessAnnotationChecker - the checker to use

    • Method Detail

      • enable

        public void enable()

        Enables the access checker.

        This must be called for the access checker to perform any checks. By default the access checker is disabled.

      • setLoginView

        public void setLoginView(Class<? extends Component> loginView)

        Sets the Flow login view to use.

        The login view can only be set once and cannot be changed afterwards.

        Note that the access checker needs to be separately enabled using enable()

        Parameters:

        loginView - the Flow view to use as login view

      • setLoginView

        public void setLoginView(String loginUrl)

        Sets the Fusion login view to use.

        The login view can only be set once and cannot be changed afterwards.

        Note that the access checker needs to be separately enabled using enable()

        Parameters:

        loginUrl - the Fusion view to use as login view

      • beforeEnter

        public void beforeEnter(BeforeEnterEvent beforeEnterEvent)

        Description copied from interface: BeforeEnterHandler

        Callback executed before navigation to attaching Component chain is made.

        Specified by:

        beforeEnter in interface BeforeEnterHandler

        Parameters:

        beforeEnterEvent - before navigation event with event details