Search in sources :

Example 1 with AuthorizationFilter

use of org.apache.shiro.web.filter.authz.AuthorizationFilter in project shiro by apache.

the class ShiroFilterFactoryBean method applyUnauthorizedUrlIfNecessary.

private void applyUnauthorizedUrlIfNecessary(Filter filter) {
    String unauthorizedUrl = getUnauthorizedUrl();
    if (StringUtils.hasText(unauthorizedUrl) && (filter instanceof AuthorizationFilter)) {
        AuthorizationFilter authzFilter = (AuthorizationFilter) filter;
        // only apply the unauthorizedUrl if they haven't explicitly configured one already:
        String existingUnauthorizedUrl = authzFilter.getUnauthorizedUrl();
        if (existingUnauthorizedUrl == null) {
            authzFilter.setUnauthorizedUrl(unauthorizedUrl);
        }
    }
}
Also used : AuthorizationFilter(org.apache.shiro.web.filter.authz.AuthorizationFilter)

Aggregations

AuthorizationFilter (org.apache.shiro.web.filter.authz.AuthorizationFilter)1