简体   繁体   English

WSO2 API 密钥管理器

[英]WSO2 API Key Manager

I am configuring our API Manager, but running into troubles authenticating via OAuth, seems to be an issue with the API Key Manager.我正在配置我们的 API 管理器,但遇到了通过 OAuth 进行身份验证的问题,这似乎是 API 密钥管理器的问题。 I haven't dug into it yet, but does this come with the API Manager (as I have assumed) or is this a separate installation?我还没有深入研究它,但这是否与 API 管理器一起提供(正如我所假设的)还是单独安装?

I had the same issue when using the wso2 api manager on a Amazon hosted machine, turn out that Thrift was not working correctly because some problem with multicasting and broadcasting.我在亚马逊托管机器上使用 wso2 api 管理器时遇到了同样的问题,结果发现 Thrift 无法正常工作,因为多播和广播存在一些问题。

What I did to get it working was to switch from ThriftClient to WSClient.为了让它工作,我所做的是从 ThriftClient 切换到 WSClient。 If you have a huge amount of requests coming in then Thrift is the recommended solution from wso2 but in any "normal" case you will not have any differences between thrift and WS.如果您收到大量请求,那么 Thrift 是 wso2 推荐的解决方案,但在任何“正常”情况下,您在 thrift 和 WS 之间不会有任何区别。

Here is how you switch:切换方法如下:

  1. Shut down the API Manager关闭 API 管理器
  2. Open up <api manager install dir>\\repository\\conf\\api-manager.xml打开<api manager install dir>\\repository\\conf\\api-manager.xml
  3. Find ThriftClient查找 ThriftClient
  4. Change this to <KeyValidatorClientType>WSClient</KeyValidatorClientType>将此更改为 <KeyValidatorClientType>WSClient</KeyValidatorClientType>
  5. Start the API Manager启动 API 管理器

You may get some Warnings while starting up but, try it before you jump to the conclusion that it doesn't work.启动时您可能会收到一些警告,但请先尝试一下,然后再得出它不起作用的结论。

Hope it helps!希望能帮助到你!

您可以在分布式设置中使用 APIM 管理器产品作为密钥管理器、网关、商店、发布者......但所有功能都在一个发行版中......查看 文档以获取更多指南

I was facing the same issue.我面临着同样的问题。 Everything started when I created my own jks in order to use SSL without a self-signed certificate.当我创建自己的 jks 以便在没有自签名证书的情况下使用 SSL 时,一切都开始了。 I successfully created the jks and changed it in the carbon file.我成功创建了 jks 并在 carbon 文件中对其进行了更改。 When I started the server, everything seemed ok;当我启动服务器时,一切似乎都很好; but when I used SOAPUI to test an API call, I got this (in the logs of the api manager):但是当我使用 SOAPUI 来测试 API 调用时,我得到了这个(在 api 管理器的日志中):

APIAuthenticationHandler API authentication failure due to Unclassified Authentication Failure

I started digging what was the problem by enabling Debug level in the log4j.properties file, and then tried again a tested with SOAPUI and I got:我开始通过在 log4j.properties 文件中启用调试级别来挖掘问题所在,然后再次尝试使用 SOAPUI 进行测试,我得到:

APISecurityException: Could not connect to <my api ip address> on port 10397

Then, I read the comment of OneMuppet and I checked that file and I found that the Thrift config has a host option, so I uncommented it:然后,我阅读了 OneMuppet 的评论并检查了该文件,我发现 Thrift 配置有一个主机选项,所以我取消了它的注释:

<KeyValidatorClientType>ThriftClient</KeyValidatorClientType>
<ThriftClientPort>10397</ThriftClientPort>
<ThriftClientConnectionTimeOut>10000</ThriftClientConnectionTimeOut>
<ThriftServerPort>10397</ThriftServerPort>

This Line -->    <ThriftServerHost>localhost</ThriftServerHost>

<EnableThriftServer>true</EnableThriftServer>

Save, restarted the server and everything start working correctly.保存,重新启动服务器,一切开始正常工作。

I got the same below issue after my installation, when i try to invoke the api service it is throwing below error: 900900 Unclassified Authentication Failure Error while accessing backend services for API key validation安装后,我遇到了以下相同的问题,当我尝试调用 api 服务时,它抛出以下错误:900900 访问后端服务进行 API 密钥验证时出现未分类的身份验证失败错误

After some random checks i have seen the axis2.xml file in /repository/conf/axis2 there it is refering a differnt ip's instead.经过一些随机检查后,我在 /repository/conf/axis2 中看到了 axis2.xml 文件,它引用了不同的 ip。 I change these ip's to my local ip and restarted.我将这些 ip 更改为我的本地 ip 并重新启动。 The issue is resolved now.现在问题已解决。

I was facing the same issue.我面临着同样的问题。 when I was trying to setup API Manager as an API Gateway in a different machine as per the steps given here,当我尝试按照此处给出的步骤在另一台机器上将 API Manager 设置为 API 网关时,

https://docs.wso2.com/display/AM250/Publish+through+Multiple+API+Gateways https://docs.wso2.com/display/AM250/Publish+through+Multiple+API+Gateways

Once the setup is done and when I am trying to use this gateway URL, I was getting the below response,设置完成后,当我尝试使用此网关 URL 时,我收到以下响应,

{"fault":{"code":900900,"message":"Unclassified Authentication Failure","description":"Error while accessing backend services for API key validation"}}

After changing the KeyValidatorClientType value to WSClient from ThriftClient on the <api manager install dir>\\repository\\conf\\api-manager.xml<api manager install dir>\\repository\\conf\\api-manager.xml上将 KeyValidatorClientType 值从 ThriftClient 更改为 WSClient 后

It started working fine.它开始工作正常。 And I was able to get the expected response.我能够得到预期的回应。

If you changed the admin password, then you also have to update the repository/conf/api-manager.xml file with the new password.如果您更改了管理员密码,那么您还必须使用新密码更新 repository/conf/api-manager.xml 文件。 The 2 places I have changed (so far) are:我改变的 2 个地方(到目前为止)是:

<AuthManager>

and

<APIKeyManager>

but there are other admin usernames in that file.但该文件中还有其他管理员用户名。 No doubt, I'll get to them....毫无疑问,我会去找他们......

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM