【问题标题】:Issue while using the wso2 api manager product api使用 wso2 api manager 产品 api 时的问题
【发布时间】:2019-02-01 13:03:34
【问题描述】:

我正在尝试探索产品 api 以使用 curl 命令创建 api。 我按照文档创建了访问令牌。在那之前它工作得很好 但是当我尝试使用以下命令调用发布者服务时,出现错误

 curl -v  -k -H "Authorization: Bearer <access token obtained>" http://<host ip address>:9763/api/am/store/v0.14/apis 


* About to connect() to <host ip address> port 9763 (#0)
*   Trying <host ip address>...
* Connected to <host ip address> (<host ip address>) port 9763 (#0)
> GET /api/am/store/v0.14/apis HTTP/1.1
> User-Agent: curl/7.29.0
> Host: <host ip address>:9763
> Accept: */*
> Authorization: Bearer <access token obtained>
>
< HTTP/1.1 401 Unauthorized
< Date: Thu, 31 Jan 2019 15:03:08 GMT
< Content-Type: application/json
< Transfer-Encoding: chunked
< Server: WSO2 Carbon Server
<
* Connection #0 to host <host ip address> left intact
{"code":401,"message":"","description":"Unauthenticated request","moreInfo":"","error":[]} 

I have rechecked my login credentials while generating the client key and then the client and client key while generating the token. I am not sure what is going wrong. Can anyone help

【问题讨论】:

    标签: wso2 wso2-am


    【解决方案1】:

    确保您在生成令牌时提供了相关范围。每个资源都有https://docs.wso2.com/display/AM260/apidocs/publisher/#!/operations#APICollection#apisGet 中定义的特定范围。在此范围是 apim:api_view。在token响应中,检查是否获取到相关范围。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-05-19
      • 1970-01-01
      相关资源
      最近更新 更多