wso2 - 无法使用 WSO2 apictl 工具登录环境
问题描述
我正在使用 WSO2 API Controller 3.1.4 和 API Manager 3.1.0。首先我使用下面的命令添加了一个环境,并且添加成功。
rocky@ProBook-450-G5:/data/wso2-products/apictl-3.1.4-linux-x64/apictl$./apictl add-env -e test \
> --apim https://localhost:9443 \
> --registration https://localhost:9443/client-registration/v0.16/register \
> --token https://localhost:8243/token
Successfully added environment 'test'
然后我尝试使用以下命令登录上面创建的测试环境。
rocky@ProBook-450-G5:/data/wso2-products/apictl-3.1.4-linux-x64/apictl$ ./apictl login test -u admin -p admin -k --verbose
对于上述命令,我收到以下错误响应消息。
Executed ImportExportCLI (apictl) on Wed, 19 Aug 2020 09:49:15 +0530
[INFO]: Insecure: trueSuccessfully added environment 'test'
Warning: Using --password in CLI is not secure. Use --password-stdin
Getting ClientID, ClientSecret: Status - 404
Error: %!s(<nil>)
Body:
Error occurred while login : Request didn't respond 200 OK: 404
当我在 REST-API 中尝试客户端注册时,我得到了成功的 200 响应。
我用来创建环境的命令有什么问题吗?
解决方案
您应该根据文档 [1] 添加如下环境。
./apictl add-env -e test \
--apim https://localhost:9443 \
--registration https://localhost:9443 \
--token https://localhost:8243/token
您不应将注册端点指定为 https://localhost:9443/client-registration/v0.16/register。这适用于旧版本(APIM 3.0.0 + APICTL 3.0.x [2])
请参阅此处以获取上述正确用例的演示(请确保在再次添加环境之前使用“./apictl remove env test”删除环境)
推荐阅读
- windows - 批处理脚本解释评论中的内容?
- wordpress - 多站点上的 WordPress ACF Pro 用户元
- docker - 使用 gcp 云构建创建 dockerfile 时出错
- excel - Excel VBA:当一个字符串是单元格中包含的文本值时,如何在 While 语句中使用 StrComp?
- php - 使用 phpWord 和 cakephp3 找不到类“Zend\Stdlib\StringUtils”
- android - Android Studio中colors.xml文件中的奇怪错误
- mysql - 如何使用 GROUP BY 并获取 MySQL 中的最后一个字符串?
- python - Tensorflow Custom Estimator: How to implement a `input_fn` function that returns a list of labels, and a list of features ?
- javascript - 如何为我的测验使用外部 json 文件
- angular - Angular 表单提交仅具有更改的字段 - 不是完整的表单值