Configuring OAuth 2.0 Redirect
Starting from CloudBlue Commerce version 21.7 this configuration is performed in the Settings menu in the UX1 for Providers. For versions earlier than 21.7, this configuration is performed through API.
Note: All operations are performed on behalf of the provider.
Configuration for version 21.7 and later
To configure OAuth 2.0 Redirect URL, complete the following steps:
-
In UX1 for Providers, go to Settings > OAuth 2.0 Redirect.
-
In the Brand field, select your brand.
-
In the OAuth 2.0 Redirect URL field, enter a custom URL suffix and click Apply.
Configuration for versions earlier than 21.7
Each request requires OAuth 2.0 Redirect Application APS ID, which is retrieved through the following API call:
Method | Path |
---|---|
GET |
/aps/2/resources?implementing(http://www.parallels.com/oauth2redirect/1.1) |
Example response:
[
{
"aps": {
"modified": "2022-07-01T11:40:01Z",
"id": "8b453624-1af7-44b3-b7ef-dfbe45c2a3ea",
"type": "http://www.parallels.com/oauth2redirect/1.1",
"status": "aps:ready",
"revision": 5
}
}
]
where id
represents the OAuth 2.0 Redirect Application APS ID.
Enabling OAuth 2.0 Redirect configuration
OAuth 2.0 Redirect uses the following URL template: <<brand>>/suffix
For example: https://ejdai.brnd2c758017-3776bb.aqa.int.zone/oauth2redirect
The brand APS ID is required to perform this operation.
The following API call returns a brand-by-brand name:
Method | Path |
---|---|
GET |
/aps/2/resources?implementing(http://parallels.com/aps/types/pa/brand/1.0),eq(name,brandName) |
where brandName
is a brand name, example ejdai.brnd2c758017-3776bb.aqa.int.zone
Example response:
[
{
"URI": "ejdai.brnd2c758017-3776bb.aqa.int.zone",
"name": "ejdai.brnd2c758017-3776bb.aqa.int.zone",
"domain": "ejdai.brnd2c758017-3776bb.aqa.int.zone",
"brandId": 12,
"aps": {
"modified": "2022-07-01T09:50:44Z",
"id": "2037fdbf-816b-497a-b0e3-57731d717901",
"type": "http://parallels.com/aps/types/pa/brand/1.0",
"status": "aps:ready",
"revision": 2
}
}
]
The following API call enables OAuth 2.0 Redirect configuration:
Method | Path |
---|---|
GET |
/aps/2/resources/{oauth2ApsId}/config |
where oauth2ApsId
is the OAuth 2.0 Redirect APS ID
Example request:
{
"brandId": "2037fdbf-816b-497a-b0e3-57731d717901",
"suffix": "oauth2redirect"
}
where:
• brandId
is the brand APS ID, which is retrieved in the previous request,
• suffix
is a custom URL suffix.
Getting OAuth 2.0 Redirect configuration
When the OAuth 2.0 Redirect configuration is enabled, the following API call returns the redirect URL information:
Example response:
{
"id": "ccdeb459-9dc4-4cc3-8ec0-1a300ab3404f",
"brandId": "2037fdbf-816b-497a-b0e3-57731d717901",
"suffix": "oauth2redirect"
}
where:
• id
is the configuration ID, which is required for disabling the configuration,
• brandId
is the brand APS ID,
• suffix
is a custom URL suffix.
Disabling OAuth 2.0 Redirect configuration
The following API call disables the OAuth 2.0 Redirect configuration:
Method | Path |
---|---|
DELETE |
/aps/2/resources/{oauth2ApsId}/config/{configId} |
where:
• oauth2ApsId
is the OAuth 2.0 Redirect APS ID,
• configId
is the configuration ID, which is retrieved from the 'Getting OAuth 2.0 Redirect configuration' API call (the id
field) above.