- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有这个 Spring 安全配置:
<?xml version="1.0" encoding="UTF-8" ?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:oauth="http://www.springframework.org/schema/security/oauth2"
xsi:schemaLocation="http://www.springframework.org/schema/security/oauth2 http://www.springframework.org/schema/security/spring-security-oauth2-2.0.xsd
http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.2.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.1.xsd ">
<http pattern="/api/swagger-ui.html" security="none" xmlns="http://www.springframework.org/schema/security"/>
<http pattern="/api/webjars/**" security="none" xmlns="http://www.springframework.org/schema/security"/>
<http pattern="/api/swagger-resources/**" security="none" xmlns="http://www.springframework.org/schema/security"/>
<http pattern="/api/v2/api-docs" security="none" xmlns="http://www.springframework.org/schema/security"/>
<http pattern="/api/**" create-session="never" entry-point-ref="oauthAuthenticationEntryPoint"
access-decision-manager-ref="accessDecisionManager" xmlns="http://www.springframework.org/schema/security">
<anonymous enabled="false"/>
<intercept-url pattern="/api/**" access="IS_AUTHENTICATED_FULLY"/>
<custom-filter ref="resourceServerFilter" before="PRE_AUTH_FILTER"/>
<access-denied-handler ref="oauthAccessDeniedHandler"/>
</http>
<bean id="accessDecisionManager" class="org.springframework.security.access.vote.UnanimousBased"
xmlns="http://www.springframework.org/schema/beans">
<constructor-arg>
<list>
<bean class="org.springframework.security.oauth2.provider.vote.ScopeVoter"/>
<bean class="org.springframework.security.access.vote.AuthenticatedVoter"/>
</list>
</constructor-arg>
</bean>
<bean id="oauthAuthenticationEntryPoint"
class="org.springframework.security.oauth2.provider.error.OAuth2AuthenticationEntryPoint">
<property name="realmName" value="sample"/>
</bean>
<bean id="oauthAccessDeniedHandler"
class="org.springframework.security.oauth2.provider.error.OAuth2AccessDeniedHandler"/>
<oauth:resource-server id="resourceServerFilter" resource-id="sample" token-services-ref="remoteTokenServices"/>
<bean id="remoteTokenServices" class="org.springframework.security.oauth2.provider.token.RemoteTokenServices">
<property name="checkTokenEndpointUrl" value="${oauth.check.token.url}"/>
<property name="clientId" value="${oauth.client:crdb}"/>
<property name="clientSecret" value="${oauth.secret:secret}"/>
</bean>
<authentication-manager alias="authenticationManager" xmlns="http://www.springframework.org/schema/security">
</authentication-manager>
<oauth:expression-handler id="oauthExpressionHandler"/>
<oauth:web-expression-handler id="oauthWebExpressionHandler"/>
</beans>
Fortify 返回给我 Spring security misconfiguration: wrong request matcher type on line 9, 10, 11, 15. 有人可以告诉我如何解决这个问题吗?好像有一些路径问题,但我对fortify不太熟悉,所以我不知道如何解决这个问题。
最佳答案
您似乎在使用 <http/>
时遇到问题用于配置的标签。仔细查看您是否使用了与该标签相关的有效属性。您可以通过单击标签来简单地识别可用的属性/属性。
好像xmlns="http://www.springframework.org/schema/security"
这是错误,因为 <http>
没有xmlns
属性(property)。
您也不需要在每个 http
中定义它.
尝试删除 xmlns
属性(property)来自 <http>
标签,它应该可以工作。
供引用:Spring Security XML Configuration
可用 <http>
配置属性:
<http pattern=""
name=""
access-decision-manager-ref=""
authentication-manager-ref=""
auto-config=""
create-session=""
disable-url-rewriting=""
entry-point-ref=""
jaas-api-provision=""
once-per-request=""
realm=""
request-matcher=""
request-matcher-ref=""
security=""
security-context-repository-ref=""
servlet-api-provision=""
use-expressions=""/>
关于spring-security - 如何解决Spring安全配置错误: incorrect request matcher type?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68068819/
尝试使用 spacy matcher 时出现错误: ~\Anaconda3\lib\site-packages\spacy\matcher\matcher.pyx in spacy.matcher.m
我想检查一个字符串是否包含另一个字符串,忽略大小写。基本上,我想这样做: assertThat(dialogTitle.getText(), containsString(equalToIgnorin
我想断言 ICollection 包含满足约束集合的项目。对于 Java Hamcrest,我会使用 Matchers.containsInAnyOrder(Matcher... matchers)。
如果我有一个 Matcher[A],如何创建一个只有当 Iterable 的每个元素都满足原始 Matcher 时才满足的 Matcher[Iterable[A]]。 class ExampleSpe
这将是一个简单的问题,但如果我的类路径中包含两个库,我找不到它们之间的区别以及使用哪一个? 最佳答案 Hamcrest 匹配器方法返回 Matcher和 Mockito 匹配器返回 T。因此,例如:o
给定一个序列 Seq[Matcher[A]]我要索取单Matcher[A]当序列中的所有匹配器都成功时,它就成功了。 编辑 我自己提供的答案似乎有点笨拙,此外,如果该序列的所有失败匹配器都产生结果,那
我看到了这个post 关于两者的区别: Matchers.hasItem(..) Assert.assertThat(items, Matchers.hasItem(Matchers.hasToStr
我对以下之间的区别有点困惑: Matcher m; m.group(); 和 Matcher m; m.pattern().pattern(); 它们都从列表中返回正确的匹配项,但我不明白两者之间的区
我正在使用 while(matcher.find()) 循环访问文件并从中检索内容。我想知道如果我知道我找到的内容的索引位于 matcher.start() 中,我将如何从这个循环中获取行号。 我很困
我试过这个例子,只是交换了两条线,它给出了不同的输出,为什么 String inputString = "username@gmail.com"; String pattern="([a-z]+@)(
以下代码在首次运行时给出异常。但是当我在匹配器行上设置断点并在 Netbeans Watcher 中评估一些命令时。有用。为什么?? String regex = "/I-TASSER/output/
是否有 Matcher.appendReplacement() 和 Matcher.appendTail() 的替代方案,它采用 StringBuilder 而不是 StringBuffer ? 是否
我需要在循环中“缩短”字符串,然后一次又一次地传递它以与 java.regex.Pattern 匹配。对于一些深入参与解析和文本处理的人来说,这可能是一个微不足道的情况。 我面临着必须使用的情况: s
为什么第一个 block 有效而第二个 block 不有效? int numberOfDigits = 2; Pattern p = Pattern.compile("[01]{"+numberOfD
我是 c# 的新手,正在尝试将以下代码转换为 c#,但在 c# 中找不到任何 api 来执行此操作。 请解释 matcher.start() 和 matcher.end() 的等价物。 c# 中 ma
我注意到调用 Matcher.lookingAt() 会影响 Matcher.find()。我在我的代码中运行了 lookingAt(),它返回了 true。然后,当我运行 find() 以便开始返回
我正在进行一些测试,以便重构一个旧的 C++ 项目。我正在尝试使用 gmock 匹配器 ElementsAreArray() 来匹配两个数组。 EXPECT_THAT(value_instance.v
我正在寻找一种方法来确定单个正则表达式是否匹配整个字符串、字符串的开头或 C# 中的一部分。 在 Java 中,您可以构造一个 Matcher 对象,并使用方法 matches() 来检查它是否与整个
给定一个 Collection 或 Iterable 项目,是否有任何 Matcher(或匹配器组合)可以断言每个项目都匹配一个匹配器? 例如,给定这个项目类型: public interface P
我看到有一些关于 Java Matcher 类的帖子,但我找不到关于特定方法 find() 和 group() 的帖子. 我有这段代码,其中 Lane 和 IllegalLaneException 已
我是一名优秀的程序员,十分优秀!