Предохранитель JBoss EAP 6 + - перехватчик CXF с OAuth2
Я должен проверить токен путем самоанализа с CXF Interceptor. Когда я звоню в сервис SOAP, я получаю:
<faultstring>HTTP 401 Unauthorized</faultstring>
С какими атрибутами я должен вызывать сервис SOAP?
Это моя конфигурация перехватчика:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:camel="http://camel.apache.org/schema/spring"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">
<context:property-placeholder location="classpath:config.properties"/>
<import resource="classpath:oauth2Interceptor.xml"/>
<bean class="it.agos.callbacks.MFPasswordCallback" id="mfPasswordCallback">
<constructor-arg value="${mf-basic-wso2-auth-pass}"/>
</bean>
<bean class="org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor" id="wss4jInInterceptor">
<constructor-arg>
<map>
<entry key="action" value="UsernameToken"/>
<entry key="passwordCallbackRef">
<ref bean="mfPasswordCallback"/>
</entry>
<entry key="user" value="${mf-basic-wso2-auth-user}"/>
<entry key="passwordType" value="PasswordText"/>
</map>
</constructor-arg>
</bean>
</beans>
И это oauth2Interceptor.xml:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:camel="http://camel.apache.org/schema/spring"
xmlns:cxf="http://cxf.apache.org/core"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">
<bean class="org.apache.cxf.jaxrs.client.JAXRSClientFactoryBean" id="identityServiceClientFactory">
<property name="address" value="https://api-kmgr-be-dev.agositafinco.it/oauth2/introspect"/>
<property name="headers">
<map>
<entry key="Accept" value="application/json"/>
<entry key="Content-Type" value="application/x-www-form-urlencoded"/>
</map>
</property>
</bean>
<bean factory-bean="identityServiceClientFactory"
factory-method="createWebClient" id="identityServiceClient"/>
<bean
class="org.apache.cxf.rs.security.oauth2.filters.AccessTokenValidatorClient" id="tokenValidator">
<property name="tokenValidatorClient" ref="identityServiceClient"/>
</bean>
<bean
class="org.apache.cxf.rs.security.oauth2.filters.OAuthRequestInterceptor" id="oauthInInterceptor">
<property name="tokenValidator" ref="tokenValidator"/>
</bean>
<cxf:bus>
<cxf:inInterceptors>
<ref bean="oauthInInterceptor"/>
</cxf:inInterceptors>
</cxf:bus>
</beans>