Skip to content

Commit 5025e63

Browse files
committed
CABPI-429: Review and Update Project Documentation
1 parent 6508982 commit 5025e63

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

app/code/Magento/AdminAdobeIms/README.md

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
# Magento_Admin_Adobe_Ims module
2-
32
The Magento_Admin_Adobe_Ims module contains integration with Adobe IMS for backend authentication.
43

54
For information about module installation in Magento 2, see [Enable or disable modules](https://devdocs.magento.com/guides/v2.4/install-gde/install/cli/install-cli-subcommands-enable.html).
65

76
# CLI command usage:
87
## bin/magento admin:adobe-ims:enable
98
Enables the AdminAdobeIMS Module. \
10-
Required values are `Organization ID`, `Client ID` and `Client Secret`
9+
Required values are `Organization ID`, `Client ID`, `Client Secret` and `2FA enabled on AdobeIMS`
1110

1211
### Argument Validation
1312
On enabling the AdminAdobeIMS Module, the input arguments will be validated. \
@@ -19,6 +18,7 @@ The pattern for the validation are configured in the di.xml
1918
<argument name="organizationIdRegex" xsi:type="string"><![CDATA[/^([A-Z0-9]{24})(@AdobeOrg)?$/i]]></argument>
2019
<argument name="clientIdRegex" xsi:type="string"><![CDATA[/[^a-z_\-0-9]/i]]></argument>
2120
<argument name="clientSecretRegex" xsi:type="string"><![CDATA[/[^a-z_\-0-9]/i]]></argument>
21+
<argument name="twoFactorAuthRegex" xsi:type="string"><![CDATA[/^y/i]]></argument>
2222
</arguments>
2323
</type>
2424
```
@@ -27,6 +27,7 @@ We check if the arguments are not empty, as they are all required.
2727

2828
For the Organization ID, Client ID and Client Secret, we check if they contain only alphanumeric characters. \
2929
Additionally for the Organization ID, we check if it matches 24 characters and optional has the suffix `@AdobeOrg`. But we only store the ID and ignore the suffix.
30+
Also make sure 2FA is enabled on AdobeIMS.
3031

3132
## bin/magento admin:adobe-ims:disable
3233
Disables the AdminAdobeIMS Module.
@@ -44,7 +45,6 @@ Client Secret configured
4445
If Admin Adobe Ims module is disabled, cli command will show message "Module is disabled"
4546

4647
# Admin Login design
47-
4848
The admin login design changes when the AdminAdobeIms module is enabled and configured correctly via the CLI command.
4949
We have added the customer layout handle `adobe_ims_login` to deal with all the design changes.
5050
This handle is added via `\Magento\AdminAdobeIms\Plugin\AddAdobeImsLayoutHandlePlugin::afterAddDefaultHandle`.
@@ -59,7 +59,6 @@ We have included the minified css and the used svgs from Spectrum CSS with our m
5959
To rebuild the minified css run the command `./node_modules/.bin/postcss -o dist/index.min.css index.css` after npm install from inside the web directory.
6060

6161
# AdminAdobeIMS Callback
62-
6362
For the AdobeIMS Login we provide a redirect_uri on the request. After a successful Login in AdobeIMS, we get redirected to provided redirect_uri.
6463

6564
In the ImsCallback Controller we get the access_token and then the user profile.
@@ -68,15 +67,13 @@ We then check if the assigned organization is valid and if the user does exist i
6867
If there went something wrong during the authorization, the user gets redirected to the admin login page and an error message is shown.
6968

7069
# Organization ID Validation
71-
7270
During the authorization we check if the configured `Organization ID` provided on the enabling CLI command is assigned to the user.
7371

7472
In the profile response from Adobe IMS must be a `roles` array. There we have all assigned organizations to the user.
7573

7674
We compare if the configured organization ID does exist in this array and also the structure of the organization ID is valid.
7775

7876
# Admin Backend Login
79-
8077
Login with the help Adobe IMS Service is implemented. The redirect to Adobe IMS Service is performed-
8178
The redirect from Adobe IMS is done to \Magento\AdminAdobeIms\Controller\Adminhtml\OAuth\ImsCallback controller.
8279

@@ -97,14 +94,12 @@ If token is valid, value token_last_check_time will be updated to current time a
9794
If token is not valid, session will be destroyed.
9895

9996
# Admin Backend Logout
100-
10197
The logout from Adobe IMS Service is performed when Magento Admin User is logged out.
10298
It's triggered by the event `controller_action_predispatch_adminhtml_auth_logout`
10399

104100
We do external LogOut by call to IMS. Session revoke is standard magento behavior
105101

106102
# Admin Created Email
107-
108103
We created an Observer for the `admin_user_save_after` event. \
109104
There we check if the customer object is newly created or not. \
110105
When a new admin user got created in Magento, he will then receive an email with further information on how to login.
@@ -154,7 +149,6 @@ Instead, the forgot password function must be used to reset the password.
154149

155150

156151
# WEB API authentication using IMS ACCESS_TOKEN
157-
158152
When Admin Adobe IMS is enabled, Adobe Commerce admin users will stop having credentials (username and password).
159153
These admin user credentials are needed for getting token that can be used to make requests to admin web APIs.
160154
It means that will be not possible to create token because admin doesn't have credentials. In these case we have to use IMS access token.
@@ -202,7 +196,6 @@ curl -X GET "{domain}/rest/V1/customers/2" -H "Authorization: Bearer AddAdobeIms
202196
curl -X GET "{domain}/rest/V1/products/24-MB01" -H "Authorization: Bearer AddAdobeImsAccessToken"
203197

204198
###Two-factor authentication.
205-
206199
During CLI enablement of the module, the admin user is asked, whether 2FA is enabled for him on Adobe side.
207200
If the answer is yes, Magento TFA module (if it's present in the code base), should be disable.
208201

@@ -222,4 +215,4 @@ When the form will be submitted, we verify the identity with the `Magento/AdminA
222215
Here the existens of the `AdobeAccessToken` and `AdobeReAuthToken` will be checked.
223216
The reauth_token will be used to call the AdobeIms validateToken Endpoint.
224217

225-
When this call is successfull, the form will be submitted, otherwise we update the Message of the thrown `AuthenticationException` to return a matching error message, done by the `Magento/AdminAdobeIms/Plugin/PerformIdentityCheckMessagePlugin.php` Plugin.
218+
When this call is successful, the form will be submitted, otherwise we update the Message of the thrown `AuthenticationException` to return a matching error message, done by the `Magento/AdminAdobeIms/Plugin/PerformIdentityCheckMessagePlugin.php` Plugin.

0 commit comments

Comments
 (0)