【问题标题】:WSO2 APIM 2.6.0 publishing APIs using RestAPIsWSO2 APIM 2.6.0 使用 RestAPI 发布 API
【发布时间】:2019-10-08 15:02:34
【问题描述】:

我最近将 WSO2 APIM 从 2.5.0 升级到 2.6.0

目前,执行基本测试并且一切正常。我也在使用 MSSQL 数据库。

现在,我使用 restAPI 在发布者中创建 API,然后发布 API。这两个功能都运行良好。但是,我在调用 API 时确实看到了一个问题。

所以为了测试它,我订阅了已发布的 API,并使用正确的令牌调用它。 首次调用 API 时,出现以下错误

    TID: [-1234] [] [2019-10-08 14:58:16,263]  WARN {org.wso2.carbon.apimgt.keymgt.service.thrift.APIKeyValidationServiceImpl} -  Invalid session id for thrift authenticator. {org.wso2.carbon.apimgt.keymgt.service.thrift.APIKeyValidationServiceImpl}
    TID: [-1234] [] [2019-10-08 14:58:16,263] ERROR {org.wso2.carbon.apimgt.keymgt.service.thrift.APIKeyValidationServiceImpl} -  Error in invoking validate key via thrift.. {org.wso2.carbon.apimgt.keymgt.service.thrift.APIKeyValidationServiceImpl}
    TID: [-1234] [] [2019-10-08 14:58:16,264]  WARN {org.wso2.carbon.apimgt.gateway.handlers.security.thrift.ThriftKeyValidatorClient} -  Login failed.. Authenticating again.. {org.wso2.carbon.apimgt.gateway.handlers.security.thrift.ThriftKeyValidatorClient}
    TID: [-1234] [] [2019-10-08 14:58:16,338]  INFO {org.wso2.carbon.core.services.util.CarbonAuthenticationUtil} -  'admin@carbon.super [-1234]' logged in at [2019-10-08 14:58:16,338+0000] from IP address  {org.wso2.carbon.core.services.util.CarbonAuthenticationUtil}
    TID: [-1234] [] [2019-10-08 14:58:16,370]  WARN {org.wso2.carbon.apimgt.gateway.handlers.security.APIAuthenticationHandler} -  API authentication failure due to No matching resource found in the API for the given request {org.wso2.carbon.apimgt.gateway.handlers.security.APIAuthenticationHandler}

然后,随后的调用在下面给出

    TID: [-1234] [] [2019-10-08 14:59:29,462]  WARN {org.wso2.carbon.apimgt.gateway.handlers.security.APIAuthenticationHandler} -  API authentication failure due to No matching resource found in the API for the given request {org.wso2.carbon.apimgt.gateway.handlers.security.APIAuthenticationHandler}

现在,我要做的是从 /publisher 门户重新发布 API,然后使用相同的 oauth 令牌再次调用它,它可以正常工作,没有任何问题。

有人可以在这里帮助我吗?有人在 2.6.0 中遇到过这个问题吗?

谢谢

【问题讨论】:

    标签: wso2 wso2-am wso2carbon


    【解决方案1】:

    “API 身份验证失败,原因是在 API 中找不到给定请求的匹配资源”

    原因是调度 API 调用请求后资源验证失败。并且可能是由于在数据库中找不到对应的API资源或者资源不明确的场景。因此,请在发布并通过 Rest API 调用 API 后检查数据库中是否存在确切的资源。

    【讨论】:

    • 是的,数据库中的条目是准确的,没有区别。但是,在编辑 API 时单击管理选项卡中的保存后,它可以正常工作
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多