0

熔断 2.3.0.redhat-60024 和 Spring 命名空间

我正在尝试使用使用 oauth1 (mvn:org.springframework.security.oauth/spring-security-oauth/1.0.5.RELEASE) 的 Spring 实现的 fuse 开发解决方案。这个 spring 包似乎具有我发现的最好的客户端支持,并且我已经在 spring 中实现了它(在 tomcat 中运行),但在 Fuse 中没有。

spring 包的命名空间和模式位置是: http ://www.springframework.org/schema/security/oauth http://www.springframework.org/schema/security/spring-security-oauth-1.0.xsd

但是,当我在 blueprint.xml 文件中使用此命名空间并安装捆绑包时,捆绑包不会启动。在控制台上,显示“GracePeriod”。在日志中,我得到以下信息:

17:23:44,490 | 信息 | NAPSHOT-thread-1 | BlueprintContainerImpl | 14 - org.apache.aries.blueprint.core - 1.0.1.redhat-60024 | 捆绑 com.transverse.tract.connect.tc-core-auth-oauth 正在等待命名空间处理程序 [ http://www.springframework.org/schema/security/oauth]

我尝试了许多解决方案,但没有一个允许注册或链接到 OSGi 服务的 oauth 命名空间类,而且我总是收到此消息。

请给我一些指示。我在下面包含了蓝图文件。需要帮助请叫我。

<?xml version="1.0" encoding="UTF-8"?>
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0"
    xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.1.0"
    xmlns:oauth1="http://www.springframework.org/schema/security/oauth"
    xsi:schemaLocation="
        http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
        http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0 http://aries.apache.org/schemas/blueprint-cm/blueprint-cm-1.1.0.xsd
        http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.1.0 http://aries.apache.org/schemas/blueprint-ext/blueprint-ext-1.1.xsd
        http://www.springframework.org/schema/security/oauth http://www.springframework.org/schema/security/spring-security-oauth-1.0.xsd">
    <ext:property-placeholder placeholder-prefix="${[" placeholder-suffix="]}"/>

    <!--  
    <mvc:default-servlet-handler/>

    <sec:debug/>
    <sec:http auto-config="true" security="none" pattern="/**"/>

    <ctx:spring-configured/>
    <ctx:annotation-config/>
    -->
    <bean id="protectedResourceDetailsService" class="org.springframework.security.oauth.consumer.InMemoryProtectedResourceDetailsService"/>
    <bean id="oauthConsumer" class="org.springframework.security.oauth.consumer.client.CoreOAuthConsumerSupport"/>

    <oauth1:consumer resource-details-service-ref="tcOAuth10aResourceDetails" support-ref="oauthConsumer">
        <oauth1:url pattern="cxf/oauth/request_token" resources="oauthProvider" httpMethod="GET"/>
        <oauth1:url pattern="cxf/oauth/access_token" resources="oauthProvider" httpMethod="GET"/>
    </oauth1:consumer>


    <oauth1:consumer-details-service id="tcOAuth10aConsumerDetails">
        <oauth1:consumer name="oauthConsumerDetails"
                        resourceName="oauthProvider"
                        key="..."
                        secret="..."
                        requiredToObtainAuthenticatedToken="true"
                        typeOfSecret="shared"
                        resourceDescription="OAuth"/>
    </oauth1:consumer-details-service>
    <oauth1:resource-details-service id="tcOAuth10aResourceDetails">
        <oauth1:resource id="quickbooksOnlineProvider"
                        key="..."
                        secret="..."
                        user-authorization-callback-param="oauth_callback"
                        user-authorization-token-param="requestToken"
                        request-token-url="https://oauth.intuit.com/oauth/v1/get_request_token"
                        user-authorization-url="https://appcenter.intuit.com/Connect/Begin"
                        access-token-url="https://oauth.intuit.com/oauth/v1/get_access_token"
                        signature-method="HMAC-SHA1"
                        accepts-authorization-header="true"
                        use10a="true"
                        access-token-method="POST"
                        request-token-method="POST"/>
    </oauth1:resource-details-service>
</blueprint>
4

1 回答 1

0

对此不太确定,因为我从未在 FUSE 中使用过 OAuth。但是,您的 FUSE 安装中似乎没有安装 Spring OAuth OSGI 功能。您是否检查过 Spring OAuth 库是否启用了 OSGI 以及 Spring OAuth OSGI 功能是否完全退出?如果有这样的功能,您可以验证features:list | grep oauth它是否正确安装在您的 FUSE 安装中。

如果 Spring OAuth 库不是 OSGI-fied,那么您可以使用 CXF-RS 实现。在这里查看如何做到这一点。

于 2014-06-27T07:54:57.033 回答