Code: CANNOT_GENERATE_TOKEN
Hello,
I'm trying to generate a Cloud Manage API access token to eventually automate some Adobe I/O CLI commands. This automation will eventually be run from AWS Lambda to send AEM access logs to AWS S3 so we will not be able to authenticate manually.
Eventual commands to automate at minimum:
- aio cloudmanager:environment:download-logs ENVIRONMENTID SERVICE NAME [DAYS]
- aio cloudmanager:environment:tail-log ENVIRONMENTID SERVICE NAME
Using this Github content to setup authentication:
Using Service Account Authentication, not Browser-based.
https://github.com/adobe/aio-cli-plugin-cloudmanager/blob/main/README.md
Adobe I/O CLI already installed.
I've setup a (JWT) Service Account with a Cloud Manager API and generated a private/public key pair.
I've updated the relevant values from the JWT service account in a config.json file as described.
//config.json
{
"client_id": "value from your CLI integration (String)",
"client_secret": "value from your CLI integration (String)",
"technical_account_id": "value from your CLI integration (String)",
"ims_org_id": "value from your CLI integration (String)",
"meta_scopes": [
"ent_cloudmgr_sdk"
]
}
I have the config.json and private.key files in my local directory.
I've run these commands to set the cloud manager credentials:
aio config:set jwt-auth config.json --file --json
aio config:set jwt-auth.jwt_private_key private.key --file
aio config:set cloudmanager_programid PROGRAMID
When I attempt to run any of the aio commands that need to authenticate, it is not able to generate the access token.:
$ LOG_LEVEL=debug aio cloudmanager:list-programs
2023-08-13T15:37:45.252Z [@adobe/aio-cli-plugin-cloudmanager:migrate-jwt-context-hook] debug: start jwt-auth migration hook
2023-08-13T15:37:45.256Z [@adobe/aio-cli-plugin-cloudmanager:migrate-jwt-context-hook] debug: New IMS configuration detected in global. No need to migrate.
2023-08-13T15:37:45.256Z [@adobe/aio-cli-plugin-cloudmanager:migrate-jwt-context-hook] debug: end jwt-auth migration hook
2023-08-13T15:37:45.449Z [@adobe/aio-lib-env] debug: supported envs: ["prod","stage"]
2023-08-13T15:37:45.449Z [@adobe/aio-lib-env] debug: default env: prod
2023-08-13T15:37:45.449Z [@adobe/aio-lib-env] debug: config key to check for env: cli.env
2023-08-13T15:37:45.449Z [@adobe/aio-lib-env] debug: config key value set for env: undefined
› Error: [IMSSDK:CANNOT_GENERATE_TOKEN] Cannot generate token because no plugin
› supports configuration:
› [plugin:cli]: [IMSOAuthSDK:MISSING_PROPERTIES] OAuth2 not supported due to some
› missing properties: cli.bare-output
› [plugin:jwt]: [IMSJWTSDK:MISSING_PROPERTIES] JWT not supported due to some
› missing properties: private_key
› [plugin:oauth]: [IMSOAuthSDK:MISSING_PROPERTIES] OAuth2 not supported due to
› some missing properties: scope
› Code: CANNOT_GENERATE_TOKEN
Any help or guidance is appreciated.
TIA