我一直在尝试为shiro.ini文件的url部分为Web应用程序分配不同的未授权URL,但似乎我无法做到.Below是我尝试过的代码.
shiro.ini文件
[main]
authc1 = org.apache.shiro.web.filter.authc.FormAuthenticationFilter
authc2 = org.apache.shiro.web.filter.authc.FormAuthenticationFilter
authc1.loginUrl = /login.xhtml
authc2.loginUrl = /secLoginPage.xhtml
[urls]
/login.xhtml = authc1
/secLoginPage.xhtml = authc2
/testapp/** = authc1, roles[admin,unauthorizedUrl=/adminAuthPage.xhtml]
/userfld/**=authc2,roles[user,unauthorizedUrl=/abortPage.xhtml]
/** = authc1
/** = authc2
Run Code Online (Sandbox Code Playgroud)
登录到应用程序后,它会重定向到授权页面并出现错误Error 401: SRVE0295E: Error reported: 401.
添加后发生此错误unauthorizedUrl=/adminAuthPage.xhtml.如果代码中有任何错误,请建议.