使用WSO2 Enterprise IntegratorESBAPI /端点无法从WSO2 API管理器获取访问令牌

问题描述

要求

我必须在WSO2 Integrator中创建一个API,以通过使用带有client_credentials许可的wso2 APIM访问令牌终结点来生成访问令牌。

  WSO2 token endpint -  http://myapim:8243/token
  grant type  - client_credentials

我已经在wso2集成器中按序列创建了一个端点,如下所示,但无法为以下代码生成令牌。

<sequence name="Accesstoken" onError="ExceptionHandler" trace="disable" xmlns="http://ws.apache.org/ns/synapse">
    <payloadFactory media-type="xml">
        <format>
            <grant_type>client_credentials</grant_type>
        </format>
        <args>
            <arg value="client_credentials"/>
        </args>
    </payloadFactory>
     
    <header name="Authorization" scope="transport" value="Basic SmhUMfgfgfgfgfkjkjkjkjkLaXNh"/>
    <header name="Content-Type" scope="transport" value="application/x-www-form-urlencoded"/>
    <log level="full"/>
    <send>
        <endpoint>
            <http method="post" uri-template="http://myapim:8243/token">
                <suspendOnFailure>
                    <initialDuration>-1</initialDuration>
                    <progressionFactor>1</progressionFactor>
                </suspendOnFailure>
                <markForSuspension>
                    <retriesBeforeSuspension>0</retriesBeforeSuspension>
                </markForSuspension>
            </http>
        </endpoint>
    </send>
</sequence>

错误:- 得到以下警告

Connection time out after while in state : REQUEST_DONE Socket Timeout : 180000 correlation_id : null Remote Address : localhost/127.0.0.1:8290
[2020-09-09 19:39:29,814]  WARN {org.apache.synapse.core.axis2.SynapseCallbackReceiver} - Synapse received a response for the request with message Id : urn:uuid:cf3c34a9-2dd5-4947-b0e9-7d2d19922140 and correlation_id : null But a callback is not registered (anymore) to process this response
[2020-09-09 19:39:29,821]  INFO {org.apache.synapse.transport.passthru.sourceHandler} - Writer null when calling informWriterError

预期的响应

需要创建WSO2 ESB / EI API或代理来调用WSO2 APIM令牌端点,以使用client_credentails授予来生成访问令牌。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)