首页 文章

wso2 api经理聚类

提问于
浏览
1

我正在尝试为WSO2 api管理器设置一个集群,我正在关注https://docs.wso2.com/display/CLUSTER44x/Clustering+API+Manager+1.10.0

我正在为每个组件使用单独的VM,目前在我的设置中我能够

  • 使用在网关中发布的发布者发布api(在日志中可见)

  • 从商店订阅此API并生成密钥

但是,当我尝试使用生成的密钥访问此API时,我得到以下响应

<soapenv:Fault xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <faultcode xmlns:axis2ns2="http://schemas.xmlsoap.org/soap/envelope/">axis2ns2:Client</faultcode>
    <faultstring>Authentication Failure</faultstring>
    <detail>Error while accessing backend services for API key validation</detail>
</soapenv:Fault>

在网关日志中,我只能看到以下行 . 日志中没有进一步的细节

TID: [-1234] [] [2016-02-02 16:55:58,288]  WARN {org.wso2.carbon.apimgt.gateway.handlers.security.APIAuthenticat
ionHandler} -  API authentication failure due to Unclassified Authentication Failure {org.wso2.carbon.apimgt.gat
eway.handlers.security.APIAuthenticationHandler}

请帮我解决这个问题 .

3 回答

  • 1

    这听起来像是你的API的问题 - 除非你使用身份服务器,否则API管理器实际上并不是"authenticate anything",因为身份验证和授权之间存在差异(WSO2通过Oauth做了什么) . 请尝试使用已知工作的API,例如http://petstore.swagger.io/并报告错误 .

  • 0

    由于许多原因,这可能发生 . 请检查下面的一些原因

    • 密钥管理器's public certificate isn' y在 <GATEWAY_HOME>/repository/resources/security/client-truststore.jks 中正确导入

    • 打开网关和密钥管理器节点的api-manager.xml文件,并将 <KeyValidatorClientType> 更改为WSClient(默认值为 ThriftClient ) .

    <KeyValidatorClientType>WSClient</KeyValidatorClientType>
    
  • 0

    造成这种情况的原因可能是节点之间配置错误 . 首先,您可以仔细检查配置(特别是与keyvalidator相关的配置)

    如果您在那里找不到任何问题,那么您可以启用调试日志并了解该问题

    在网关节点的repository / conf / log4j.properties中添加以下内容

    log4j.logger.org.wso2.carbon.apimgt.gateway.handlers.security=DEBUG
    

    在密钥管理器节点的repository / conf / log4j.properties中添加以下entires

    log4j.logger.org.wso2.carbon.apimgt.keymgt=DEBUG
    

    您可以通过分析日志找到问题

相关问题