WSO2apictlツールを使用して環境にログインできません
WSO2 API Controller3.1.4とAPIManager3.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でclient-registrationを試したところ、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])
[1] https://apim.docs.wso2.com/en/latest/learn/api-controller/getting-started-with-wso2-api-controller/#add-an-environment
[2] https://apim.docs.wso2.com/en/3.0.0/learn/api-controller/getting-started-with-wso2-api-controller/#add-an-environment
上記の正しい使用例のデモについては、こちらを参照してください(環境を再度追加する前に、必ず「./apictl removeenvtest」を使用して環境を削除してください)