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: .github/CONTRIBUTING.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
Contributions to the Adobe IMS codebase are done using the fork & pull model.
4
4
This contribution model has contributors maintaining their own fork of the Adobe IMS repository.
5
-
The forked repository is then used to submit a request to the base repository to “pull” a set of changes.
5
+
The forked repository is then used to submit a request to the base repository to "pull" a set of changes.
6
6
For more information on pull requests please refer to [GitHub Help](https://help.github.com/articles/about-pull-requests/).
7
7
8
8
Contributions can take the form of new components or features, changes to existing features, tests, documentation (such as developer guides, user guides, examples, or specifications), bug fixes or optimizations.
@@ -15,14 +15,14 @@ For more detailed information on contribution please read our [beginners guide](
15
15
16
16
## Contribution requirements
17
17
18
-
1. Contributions must adhere to the [Magento coding standards](https://devdocs.magento.com/guides/v2.3/coding-standards/bk-coding-standards.html).
18
+
1. Contributions must adhere to the [coding standards](https://developer.adobe.com/commerce/php/coding-standards/).
19
19
2. Pull requests (PRs) must be accompanied by a meaningful description of their purpose. Comprehensive descriptions increase the chances of a pull request being merged quickly and without additional clarification requests.
20
20
3. Commits must be accompanied by meaningful commit messages. Please see the [Adobe IMS Pull Request Template](https://github.com/magento/adobe-ims/blob/master/.github/PULL_REQUEST_TEMPLATE.md) for more information.
21
21
4. PRs which include bug fixes must be accompanied with a step-by-step description of how to reproduce the bug.
22
-
3. PRs which include new logic or new features must be submitted along with:
23
-
* Unit/integration test coverage
24
-
* Proposed [documentation](https://devdocs.magento.com) updates. Documentation contributions can be submitted via the [devdocs GitHub](https://github.com/magento/devdocs).
25
-
4. For larger features or changes, please [open an issue](https://github.com/magento/adobe-ims/issues) to discuss the proposed changes prior to development. This may prevent duplicate or unnecessary effort and allow other contributors to provide input.
22
+
5. PRs which include new logic or new features must be submitted along with:
23
+
* Unit/integration test coverage
24
+
* Proposed [documentation](https://developer.adobe.com/commerce) updates. Use feedback buttons __Edit in GitHub__ and __Log an issue__ at the top of a relevant topic.
25
+
6. For larger features or changes, please [open an issue](https://github.com/magento/adobe-ims/issues) to discuss the proposed changes prior to development. This may prevent duplicate or unnecessary effort and allow other contributors to provide input.
26
26
27
27
## Contribution process
28
28
@@ -32,7 +32,7 @@ This will allow you to collaborate with the Adobe IMS development team, fork the
32
32
1. Search current [listed issues](https://github.com/magento/adobe-ims/issues) (open or closed) for similar proposals of intended contribution before starting work on a new contribution.
33
33
2. Review the [Contributor License Agreement](https://opensource.adobe.com/cla.html) if this is your first time contributing.
34
34
3. Create and test your work.
35
-
4. Fork the Adobe IMS repository according to the [Fork A Repository instructions](https://devdocs.magento.com/guides/v2.3/contributor-guide/contributing.html#fork)and when you are ready to send us a pull request – follow the [Create A Pull Request instructions](https://devdocs.magento.com/guides/v2.3/contributor-guide/contributing.html#pull_request).
35
+
4. Fork the Adobe IMS repository according to the [Forks and pull requests instructions](https://developer.adobe.com/commerce/contributor/guides/code-contributions/#forks-and-pull-requests).
36
36
5. Once your contribution is received the Adobe IMS development team will review the contribution and collaborate with you as needed.
Copy file name to clipboardExpand all lines: AdminAdobeIms/README.md
+53-25Lines changed: 53 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,16 +1,20 @@
1
1
# Magento_Admin_Adobe_Ims module
2
+
2
3
The Magento_Admin_Adobe_Ims module contains integration with Adobe IMS for backend authentication.
3
4
4
-
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).
5
+
For information about module installation, see [Enable or disable modules](https://experienceleague.adobe.com/docs/commerce-operations/installation-guide/tutorials/manage-modules.html).
6
+
7
+
## CLI command usage
8
+
9
+
### bin/magento admin:adobe-ims:enable
5
10
6
-
# CLI command usage:
7
-
## bin/magento admin:adobe-ims:enable
8
11
Enables the AdminAdobeIMS Module. \
9
12
Required values are `Organization ID`, `Client ID`, `Client Secret` and `2FA enabled`
10
13
11
14
When AdminAdobeIms module is enabled, new role `Adobe Ims` is created by default.
12
15
13
-
### Argument Validation
16
+
#### Argument Validation
17
+
14
18
On enabling the AdminAdobeIMS Module, the input arguments will be validated. \
15
19
The pattern for the validation are configured in the di.xml
16
20
@@ -31,27 +35,32 @@ For the Organization ID, Client ID and Client Secret, we check if they contain o
31
35
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.
32
36
Also make sure 2FA is enabled for the Organization in Adobe Admin Console.
33
37
34
-
## bin/magento admin:adobe-ims:disable
38
+
### bin/magento admin:adobe-ims:disable
39
+
35
40
Disables the AdminAdobeIMS Module.
36
41
When disabling, the `Organization ID`, `Client ID` and `Client Secret` values will be deleted from the config.
37
42
38
-
## bin/magento admin:adobe-ims:status
43
+
### bin/magento admin:adobe-ims:status
44
+
39
45
Shows if the AdminAdobeIMS Module is enabled or disabled
40
46
41
-
## bin/magento admin:adobe-ims:info
47
+
### bin/magento admin:adobe-ims:info
48
+
42
49
Example of getting data if Admin Adobe Ims module is enabled:\
43
50
Client ID: 1234567890a \
44
51
Organization ID: 1234567890@org \
45
52
Client Secret configured
46
53
47
54
If Admin Adobe Ims module is disabled, cli command will show message "Module is disabled"
48
55
49
-
# Admin Login design
56
+
## Admin Login design
57
+
50
58
The admin login design changes when the AdminAdobeIms module is enabled and configured correctly via the CLI command.
51
59
We have added the customer layout handle `adobe_ims_login` to deal with all the design changes.
52
60
This handle is added via `\Magento\AdminAdobeIms\Plugin\AddAdobeImsLayoutHandlePlugin::afterAddDefaultHandle`.
53
61
54
62
The layout file `view/adminhtml/layout/adobe_ims_login.xml` adds:
63
+
55
64
* The bundled [Adobe Spectrum CSS](https://opensource.adobe.com/spectrum-css/).
56
65
* New classes to current Magento html items,
57
66
* Our new "Login with Adobe ID" button template,
@@ -60,33 +69,38 @@ The layout file `view/adminhtml/layout/adobe_ims_login.xml` adds:
60
69
We have included the minified css and the used svgs from Spectrum CSS with our module, but you can also use npm to install the latest versions.
61
70
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.
62
71
63
-
# AdminAdobeIMS Callback
72
+
## AdminAdobeIMS Callback
73
+
64
74
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.
65
75
66
76
In the ImsCallback Controller, we call the UserContextInterface and redirected to AdobeImsAdminTokenUserContext which is responsible for Authorization related operations.
67
77
68
78
If something went wrong during the authorization, the user gets redirected to the admin login page and an error message is shown.
69
79
70
-
There is a dispatch method created for validating the state of IMS. To prevent CSRF Threat against OAuth 2 redirect-uri, an additional param ‘state’ is added to the redirect URL and the code is verifying whether it is the same returned after authentication from IMS.
80
+
There is a dispatch method created for validating the state of IMS. To prevent CSRF Threat against OAuth 2 redirect-uri, an additional param 'state' is added to the redirect URL and the code is verifying whether it is the same returned after authentication from IMS.
81
+
82
+
## AdobeImsAdminTokenUserContext Authorization
71
83
72
-
# AdobeImsAdminTokenUserContext Authorization
73
84
This provides a unified way of implementing UserContextInterface for authorization and login to the Admin Panel. Model class method getUserId() ensures the user is already logged in by checking if access_token is already present in the session and returns the user id.
74
85
75
86
If not logged in, it calls AdobeImsAdminTokenUserService and authenticates an admin user by getting access_token and redirecting to Admin Dashboard if login is successful in AdobeIMS.
76
87
77
-
# AdobeImsAdminTokenUserService Service
88
+
## AdobeImsAdminTokenUserService Service
89
+
78
90
In the AdobeImsAdminTokenUserService service class, we call AdobeIMS API and get the access_token. After that, we get the user profile and also verify if the assigned organization is valid. If the user exists in the Magento database, it gets successfully logged in to Magento Admin.
79
91
80
92
If the user doesn't exist in Magento database, it creates the user with new role `Adobe Ims` assigned and profile info gets inherited from AdobeIMS.
81
93
82
-
# Organization ID Validation
94
+
## Organization ID Validation
95
+
83
96
During the authorization we check if the configured `Organization ID` provided on the enabling CLI command is assigned to the user.
84
97
85
98
In the profile response from Adobe IMS must be a `roles` array. There we have all assigned organizations to the user.
86
99
87
100
We compare if the configured organization ID does exist in this array and also the structure of the organization ID is valid.
88
101
89
-
# Admin Backend Login
102
+
## Admin Backend Login
103
+
90
104
Login with the help Adobe IMS Service is implemented. The redirect to Adobe IMS Service is performed-
91
105
The redirect from Adobe IMS is done to \Magento\AdminAdobeIms\Controller\Adminhtml\OAuth\ImsCallback controller.
92
106
@@ -95,7 +109,8 @@ client id (api key) and client secret (private key).
95
109
The token response access token is used for getting user profile information.
96
110
If this is successful, the admin user will be logged in and the access tokens is added to session as well as token_last_check_time value.
97
111
98
-
# ACCESS_TOKEN saving in session and validation
112
+
## ACCESS_TOKEN saving in session and validation
113
+
99
114
When AdminAdobeIms module is enabled, we check each 10 minutes if ACCESS_TOKEN is still valid.
100
115
For this when admin user login and when session is started, we add 2 extra variables to the session:
101
116
token_last_check_time is current time
@@ -106,13 +121,15 @@ If yes, then we make call to IMS to validate access_token.
106
121
If token is valid, value token_last_check_time will be updated to current time and session prolong.
107
122
If token is not valid, session will be destroyed.
108
123
109
-
# Admin Backend Logout
124
+
## Admin Backend Logout
125
+
110
126
The logout from Adobe IMS Service is performed when Magento Admin User is logged out.
111
127
It's triggered by the event `controller_action_predispatch_adminhtml_auth_logout`
112
128
113
129
We do external LogOut by call to IMS. Session revoke is standard Magento behavior
114
130
115
-
# Admin Created Email
131
+
## Admin Created Email
132
+
116
133
We created an Observer for the `admin_user_save_after` event. \
117
134
There we check if the customer object is newly created or not. \
118
135
When a new admin user got created in Magento, he will then receive an email with further information on how to login.
@@ -122,25 +139,30 @@ They are called `admin_adobe_ims_email_header_template` and `admin_adobe_ims_ema
122
139
123
140
The notification mail will be sent inside our `AdminNotificationService` where we can add and modify the template variables.
124
141
125
-
# Error Handling
142
+
## Error Handling
143
+
126
144
For the AdminAdobeIms Module we have two specific error messages and one general error message which are shown on the Admin Login page when an error occured.
127
145
128
146
### AdobeImsTokenAuthorizationException
147
+
129
148
Will be thrown when there was an error during the authorization. \
130
149
e. g. a call to AdobeIMS fails or there was no matching admin found in the Magento database.
131
150
132
151
### AdobeImsOrganizationAuthorizationException
152
+
133
153
Will be thrown when the admin user who wants to log in does not have the configured organization ID assigned to his AdobeIMS Profile.
134
154
135
155
### Error logging
156
+
136
157
Whenever an exception is thrown during the Adobe IMS Login, we will log the specific exception message but show a general error message on the admin login form.
137
158
138
159
Errors are logged into the `/var/log/admin_adobe_ims.log` file.
139
160
140
161
Logging can be enabled or disabled in the config on changing the value for `adobe_ims\integration\logging_enabled` or in the Magento Admin Configuration under `Advanced > Developer > Debug`. \
141
162
There you can switch the toggle for `Enable Logging for Admin Adobe IMS Module`
142
163
143
-
# Password usage in Admin UI
164
+
## Password usage in Admin UI
165
+
144
166
When the AdobeAdminIMS Module is enabled, we do not need any password fields in the Magento admin backend anymore.
145
167
146
168
So we removed the "Password" and "Password Confirmation" fields of the user forms.
@@ -162,7 +184,8 @@ This can be found in the `\Magento\AdminAdobeIms\Plugin\DisableForcedPasswordCha
162
184
When the AdminAdobeIMS Module is disabled, the user can not be log in when using an empty password.
163
185
Instead, the forgot password function must be used to reset the password.
164
186
165
-
# WEB API authentication using IMS ACCESS_TOKEN
187
+
## WEB API authentication using IMS ACCESS_TOKEN
188
+
166
189
When Admin Adobe IMS is enabled, Adobe Commerce admin users will stop having credentials (username and password).
167
190
These admin user credentials are needed for getting token that can be used to make requests to admin web APIs.
168
191
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.
Copy file name to clipboardExpand all lines: AdminAdobeImsTwoFactorAuth/README.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,14 +6,14 @@ The Magento_AdminAdobeImsTwoFactorAuth module is responsible to check whether Ad
6
6
7
7
Before disabling or uninstalling this module, note that the `Magento_AdminAdobeIms` and `Magento_TwoFactorAuth` modules depends on this module.
8
8
9
-
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).
9
+
For information about module installation, see [Enable or disable modules](https://experienceleague.adobe.com/docs/commerce-operations/installation-guide/tutorials/manage-modules.html).
10
10
11
11
## Extensibility
12
12
13
-
Extension developers can interact with the Magento_AdminAdobeImsTwoFactorAuth module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html).
13
+
Extension developers can interact with the Magento_AdminAdobeImsTwoFactorAuth module. For more information about the Magento extension mechanism, see [Plug-ins](https://developer.adobe.com/commerce/php/development/components/plugins/).
14
14
15
-
[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_AdminAdobeImsTwoFactorAuth module.
15
+
[The dependency injection mechanism](https://developer.adobe.com/commerce/php/development/components/dependency-injection/) enables you to override the functionality of the Magento_AdminAdobeImsTwoFactorAuth module.
16
16
17
17
## Additional information
18
18
19
-
For information about significant changes in patch releases, see [2.4.x Release information](https://devdocs.magento.com/guides/v2.4/release-notes/bk-release-notes.html).
19
+
For information about significant changes in patch releases, see [Release information](https://experienceleague.adobe.com/docs/commerce-operations/release/notes/overview.html).
Copy file name to clipboardExpand all lines: AdobeIms/README.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,14 +10,14 @@ The Magento_AdobeIms module creates the following tables in the database:
10
10
11
11
Before disabling or uninstalling this module, note that the `Magento_AdobeStockImageAdminUi` module depends on this module.
12
12
13
-
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).
13
+
For information about module installation, see [Enable or disable modules](https://experienceleague.adobe.com/docs/commerce-operations/installation-guide/tutorials/manage-modules.html).
14
14
15
15
## Extensibility
16
16
17
-
Extension developers can interact with the Magento_AdobeIms module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html).
17
+
Extension developers can interact with the Magento_AdobeIms module. For more information about the Magento extension mechanism, see [Plugins](https://developer.adobe.com/commerce/php/development/components/plugins/).
18
18
19
-
[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_AdobeIms module.
19
+
[The dependency injection mechanism](https://developer.adobe.com/commerce/php/development/components/dependency-injection/) enables you to override the functionality of the Magento_AdobeIms module.
20
20
21
21
## Additional information
22
22
23
-
For information about significant changes in patch releases, see [2.4.x Release information](https://devdocs.magento.com/guides/v2.4/release-notes/bk-release-notes.html).
23
+
For information about significant changes in patch releases, see [Release information](https://experienceleague.adobe.com/docs/commerce-operations/release/notes/overview.html).
0 commit comments