You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+43-2Lines changed: 43 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -70,10 +70,40 @@ Alternatively, if you have selected an organization using `aio console:org:selec
70
70
71
71
To use a service account authentication, an integration (aka project) must be created in the [Adobe I/O Console](https://console.adobe.io) which has the Cloud Manager service.
72
72
73
-
***The required type of server-to-server authentication should be [Service Account (JWT)](https://developer.adobe.com/developer-console/docs/guides/authentication/ServerToServerAuthentication/#service-account-jwt-credential-deprecated).***
73
+
***The required type of server-to-server authentication should be [Service Account (JWT/OAuth)](https://developer.adobe.com/developer-console/docs/guides/authentication/ServerToServerAuthentication).***
74
+
***NOTE:*** The JWT mode of authentication is deprecated and will be completely removed by Jan,2025. So if you are using JWT integration, it is recommended to migrate to OAuth
75
+
76
+
#### Setup for OAuth integration
74
77
75
78
After you've created the integration, create a `config.json` file on your computer and navigate to the integration Overview page. From this page, copy the values into the file as described below.
79
+
```
80
+
//config.json
81
+
{
82
+
"client_id": "value from your CLI integration (String)",
83
+
"client_secret": "value from your CLI integration (String)",
84
+
"technical_account_id": "value from your CLI integration (String)",
85
+
"technical_account_email": "value from your CLI integration (String)",
86
+
"ims_org_id": "value from your CLI integration (String)",
After you've created the integration, create a `config.json` file on your computer and navigate to the integration Overview page. From this page, copy the values into the file as described below.
77
107
```
78
108
//config.json
79
109
{
@@ -83,7 +113,8 @@ After you've created the integration, create a `config.json` file on your comput
83
113
"ims_org_id": "value from your CLI integration (String)",
84
114
"meta_scopes": [
85
115
"ent_cloudmgr_sdk"
86
-
]
116
+
],
117
+
"oauth_enabled": false
87
118
}
88
119
```
89
120
@@ -1371,6 +1402,16 @@ Note that the private key **must** be base64 encoded, e.g. by running
1371
1402
$ base64 -i private.key
1372
1403
```
1373
1404
1405
+
To run tests with OAuth credentials, add the following to `.env`:
1406
+
1407
+
```
1408
+
OAUTH_E2E_CLIENT_ID=<CLIENT ID>
1409
+
OAUTH_E2E_CLIENT_SECRET=<CLIENT SECRET>
1410
+
OAUTH_E2E_TA_ID=<TECHNICAL ACCOUNT ID>
1411
+
OAUTH_E2E_TA_EMAIL=<TECHNICAL ACCOUNT EMAIL>
1412
+
OAUTH_E2E_IMS_ORG_ID=<ORG ID>
1413
+
```
1414
+
1374
1415
With this in place the end-to-end tests can be run with
Copy file name to clipboardExpand all lines: src/ConfigurationErrors.js
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -55,6 +55,7 @@ E('CLI_AUTH_NO_ORG', 'The CLI has been authenticated, but no organization has be
55
55
E('NO_DEFAULT_IMS_CONTEXT','There is no IMS context configuration defined for %s. Either define this context configuration or authenticate using "aio auth:login" and select an organization using "aio cloudmanager:org:select".')
56
56
E('IMS_CONTEXT_MISSING_FIELDS','One or more of the required fields in %s were not set. Missing keys were %s.')
57
57
E('IMS_CONTEXT_MISSING_METASCOPE','The configuration %s is missing the required metascope %s.')
58
+
E('IMS_CONTEXT_MISSING_OAUTH_SCOPES','The configuration %s is missing the required OAuth scopes %s.')
58
59
E('CLI_AUTH_EXPLICIT_NO_AUTH','cli context explicitly enabled, but not authenticated. You must run "aio auth:login" first.')
59
60
E('CLI_AUTH_EXPLICIT_NO_ORG','cli context explicitly enabled but no org id specified. Configure using either "cloudmanager_orgid" or by running "aio cloudmanager:org:select"')
60
61
E('CLI_AUTH_CONTEXT_CANNOT_DECODE','The access token configured for cli authentication cannot be decoded.')
expect(invoke()).toThrowError('One or more of the required fields in ims.contexts.aio-cli-plugin-cloudmanager were not set. Missing keys were technical_account_id, meta_scopes, private_key.')
273
294
})
274
295
275
-
test('hook -- missing scope',async()=>{
296
+
test('hook -- missing metascope for JWT',async()=>{
expect(invoke()).toThrowError('[CloudManagerCLI:IMS_CONTEXT_MISSING_OAUTH_SCOPES] The configuration ims.contexts.aio-cli-plugin-cloudmanager is missing the required OAuth scopes openid, AdobeID, read_organizations, additional_info.projectedProductContext, read_pc.dma_aem_ams')
0 commit comments