wso2 - WSO2 APIM 2.6.0 使用 RestAPI 发布 API
问题描述
我最近将 WSO2 APIM 从 2.5.0 升级到 2.6.0
目前,执行基本测试并且一切正常。我也在使用 MSSQL 数据库。
现在,使用 restAPIs,我在发布者中创建 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 中遇到过这个问题吗?
谢谢
解决方案
“API 身份验证失败,因为在给定请求的 API 中找不到匹配的资源”
原因是调度 API 调用请求后资源验证失败。并且可能是由于在数据库中找不到对应的API资源或者资源不明确的场景。因此,请在发布并通过 Rest API 调用 API 后检查数据库中是否存在确切的资源。
推荐阅读
- selenium-webdriver - 运行 selenium 脚本时出错 self._execute(Command.CLICK_ELEMENT)
- python-3.x - 使用for循环处理多个数据帧,如何将每个处理后的数据帧保存在不同的excel电子表格中?
- c# - Microsoft.Owin.Security.OAuth.OAuthAuthorizationServerProvider - 尝试从 Postman 生成令牌时,clientId 和 clientSecret 为空
- c# - 如何允许用户删除已被 Console.ReadLine() 读取的文本;
- xpages - XAgent 打破了以前的导航
- java - 在没有 Spring TaskExecutor 或线程池实现的情况下运行 Spring 项目
- sql-server - 使用MVC模型将字符串中的特殊字符存储在数据库中
- batch-file - <无缘无故出乎意料
- java - 仅装载一种类型(一种颜色)的卡车
- user-interface - 如何在 Flutter 中的卡片后面添加阴影?