No se puede iniciar sesión en un entorno usando la herramienta apictl WSO2
Estoy usando WSO2 API Controller 3.1.4 y API Manager 3.1.0. Primero agregué un entorno usando el siguiente comando y se agregó con éxito.
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'
Luego intenté iniciar sesión en el entorno de prueba creado anteriormente usando el siguiente comando.
rocky@ProBook-450-G5:/data/wso2-products/apictl-3.1.4-linux-x64/apictl$ ./apictl login test -u admin -p admin -k --verbose
Para el comando anterior, recibí el siguiente mensaje de respuesta de error.
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
Cuando probé el registro de cliente en REST-API, obtuve una respuesta 200 exitosa.
¿Hay algún problema en el comando que utilicé para crear el entorno?
Respuestas
Debe agregar el entorno como se muestra a continuación de acuerdo con la documentación [1].
./apictl add-env -e test \
--apim https://localhost:9443 \
--registration https://localhost:9443 \
--token https://localhost:8243/token
Usted debe no especificar el punto final de la inscripción como https: Registrarse 9443 / cliente-registro / v0.16 /: // localhost. Eso es para las versiones anteriores (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
Consulte aquí para ver una demostración del caso de uso correcto anterior (asegúrese de eliminar el entorno usando "./apictl remove env test" antes de agregar el entorno nuevamente)