title: Shiro setUnauthorizedUrl("/403") didn't work
body: <p>I'm using Shiro in my SpringBoot project. This is my code:</p>
  
  <pre><code>@Configuration
  public class ShiroConfiguration {
  
      @Bean
      public ShiroFilterFactoryBean shiroFilterFactoryBean(SecurityManager securityManager) {
  
          ShiroFilterFactoryBean shiroFilterFactoryBean = new ShiroFilterFactoryBean();
          shiroFilterFactoryBean.setSecurityManager(securityManager);
  
          Map&lt;String, String&gt; filterChainDefinitionMap = new LinkedHashMap&lt;&gt;();
          filterChainDefinitionMap.put("/logout", "logout");
          filterChainDefinitionMap.put("/**", "authc");
  
          shiroFilterFactoryBean.setLoginUrl("/login");
          shiroFilterFactoryBean.setSuccessUrl("/index");
          shiroFilterFactoryBean.setUnauthorizedUrl("/403");
  
          shiroFilterFactoryBean.setFilterChainDefinitionMap(filterChainDefinitionMap);
          return shiroFilterFactoryBean;
      }
  
  
      @Bean
      public SecurityManager securityManager() {
          DefaultWebSecurityManager securityManager = new DefaultWebSecurityManager();
          securityManager.setRealm(myShiroRealm());
          return securityManager;
      }
  
      @Bean
      public MyShiroRealm myShiroRealm() {
          MyShiroRealm myShiroRealm = new MyShiroRealm();
          myShiroRealm.setCredentialsMatcher(hashedCredentialsMatcher());
          return myShiroRealm;
      }
  
      @Bean
      public HashedCredentialsMatcher hashedCredentialsMatcher() {
          HashedCredentialsMatcher hashedCredentialsMatcher = new HashedCredentialsMatcher();
          hashedCredentialsMatcher.setHashAlgorithmName("md5");
          hashedCredentialsMatcher.setHashIterations(2);
          return hashedCredentialsMatcher;
      }
  
      @Bean
      public AuthorizationAttributeSourceAdvisor authorizationAttributeSourceAdvisor(SecurityManager securityManager) {
          AuthorizationAttributeSourceAdvisor advisor = new AuthorizationAttributeSourceAdvisor();
          advisor.setSecurityManager(securityManager);
          return advisor;
      }
  }
  </code></pre>
  
  <p>my Realm code:</p>
  
  <pre><code>public class MyShiroRealm extends AuthorizingRealm {
  
      @Resource
      private UserInfoService userInfoService;
  
      @Override
      protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken token) throws AuthenticationException {
  
          String username = (String) token.getPrincipal();
          UserInfo userInfo = userInfoService.findByUsername(username);
  
          if (userInfo == null) {
              return null;
          }
  
          SimpleAuthenticationInfo authenticationInfo = new SimpleAuthenticationInfo(
                  userInfo, //用户名
                  userInfo.getPassword(), //密码
                  ByteSource.Util.bytes(userInfo.getCredentialsSalt()), //salt=username+salt
                  getName() //realm name
          );
  
          return authenticationInfo;
      }
  
      @Override
      protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principals) {
  
          SimpleAuthorizationInfo authorizationInfo = new SimpleAuthorizationInfo();
          UserInfo userInfo = (UserInfo) principals.getPrimaryPrincipal();
  
          for (SysRole role: userInfo.getRoleList()) {
              authorizationInfo.addRole(role.getRole());
              for (SysPermission p: role.getPermissions()) {
                  authorizationInfo.addStringPermission(p.getPermission());
              }
          }
  
          return authorizationInfo;
      }
  }
  </code></pre>
  
  <p>I have write the code of <code>shiroFilterFactoryBean.setUnauthorizedUrl("/403");</code>,but it didn't work, i just got the AuthorizationException in Console.</p>
  
  <p>SomeOne said that <code>authc</code> doesn't support this feature, because of the code in Shiro:</p>
  
  <pre><code>private void applyUnauthorizedUrlIfNecessary(Filter filter) {
      String unauthorizedUrl = this.getUnauthorizedUrl();
      if(StringUtils.hasText(unauthorizedUrl) &amp;&amp; filter instanceof AuthorizationFilter) {
          AuthorizationFilter authzFilter = (AuthorizationFilter)filter;
          String existingUnauthorizedUrl = authzFilter.getUnauthorizedUrl();
          if(existingUnauthorizedUrl == null) {
              authzFilter.setUnauthorizedUrl(unauthorizedUrl);
          }
      }
  
  }
  </code></pre>
  
  <p>but how can it work if i use <code>authc</code>? anyone can help me?</p>