我真的不知道我是如何提出我的问题的。我开发了一个 Web 应用程序并使用了框架(Spring、SpringSecurity)
该应用程序工作正常,身份验证和管理角色和权限也是如此。
<sec:http auto-config="true" use-expressions="true">
<sec:intercept-url pattern="/pagess/admin/**" access="hasRole('ROLE_ADMIN')" />
<sec:intercept-url pattern="/pagess/**" access="hasAnyRole('ROLE_USER','ROLE_ADMIN','ROLE_VISTEUR')" />
<sec:form-login login-page="/login.jsf"
authentication-failure-url="/loginFailed.jsf" default-target-url="/Menu.jsf" />
<sec:logout logout-success-url="/login.jsf" delete-cookies="JSESSIONID"
invalidate-session="true" />
<sec:access-denied-handler error-page="/interdit.jsf"/>
<sec:session-management invalid-session-url="/login.jsf">
<sec:concurrency-control max-sessions="1"
error-if-maximum-exceeded="true" />
</sec:session-management>
</sec:http>
<sec:authentication-manager alias="authenticationManager">
<sec:authentication-provider>
<sec:jdbc-user-service data-source-ref="DataSource"
users-by-username-query="
select username,password, enabled
from utilisateur where username=?"
authorities-by-username-query="
select username, authority from utilisateur
where username =? " />
</sec:authentication-provider>
</sec:authentication-manager>
</beans:beans>
但就在今天,我注意到了一些奇怪的事情。当我在页面中时,我将之前的 google chrome 从应用程序中向上按到身份验证页面,。就在我以相反的方式拉开 Flech Advent 之后,它允许我进入应用程序,但没有身份验证是不正常的。
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/application.xml
/WEB-INF/spring_sec.xml
</param-value>
</context-param>
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Development</param-value>
</context-param>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
<filter>
<filter-name>springSecurityFilterChain</filter-name>
<filter-class>
org.springframework.web.filter.DelegatingFilterProxy
</filter-class>
</filter>
<filter-mapping>
<filter-name>springSecurityFilterChain</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>FORWARD</dispatcher>
<dispatcher>REQUEST</dispatcher>
</filter-mapping>
<listener>
<listener-class>
org.springframework.security.web.session.HttpSessionEventPublisher
</listener-class>
</listener>
<listener>
<listener-class>
org.springframework.web.context.request.RequestContextListener
</listener-class>
</listener>
我该怎么办。提前谢谢你