Apache Shiro support for Vaadin 10+ applications

This library allows you to use Vaadin 10's Router with Apache Shiro.

Instructions

Implement the Vaadin views. For example:

@Route
public class LoginView extends VerticalLayout {}

@Route
public class View1View extends VerticalLayout {}

@Route
public class View2View extends VerticalLayout {}

Add a shiro.ini file in the resources directory and set your security configuration. Configure and ese the VaadinNavigationRolesAuthorizationFilter. For example:

[main]
authc.loginUrl = /login
vaadin = org.vaadin.shiro.VaadinNavigationRolesAuthorizationFilter
vaadin.loginUrl = /login

[users]
admin = admin, admin
user = user, user

[roles]
admin = *
user = action1:*

[urls]
/ = anon, vaadin
/login = anon, vaadin
/view1 = authc, vaadin[admin]
/view2 = authc, vaadin[user]

In order for this to work you have to configure the following filters:

@WebListener
public class ShiroListener extends EnvironmentLoaderListener { }

@WebFilter(urlPatterns = "/*")
public class ShiroFilter extends VaadinShiroFilter { }

Install

Link to this version
StableReleased 22 June 2021Apache License 2.0
Framework Support
Vaadin platform 14
Install with
Release notes - Version 1.1.0

Updated to Vaadin 14.6.3 and Apache Shiro 1.7.1.