ไม่สามารถล็อกอินเข้าสู่สภาพแวดล้อมโดยใช้เครื่องมือ 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])
[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 remove env test" ก่อนเพิ่มสภาพแวดล้อมอีกครั้ง)