magento2 icon indicating copy to clipboard operation
magento2 copied to clipboard

[WebAPI] customer email confirmation via WebAPI paradox

Open wubinworks opened this issue 1 year ago • 6 comments

Preconditions and environment

  • Magento 2.4.6 & 2.4.7
  • Set config path customer/create_account/confirm to 1 and clear cache to let this setting take effect
  • Register a customer account and keep it unconfirmed

Steps to reproduce

Try activate customer via https://<domain>/rest/V1/customers/me/activate. Output: {"message":"The consumer isn't authorized to access %resources.","parameters":{"resources":"self"}

Try get customer access token as described in official document. You will get EmailNotConfirmedException(You may need a PHP debugger)

Expected result

Can activate(confirm) the customer via WebAPI.

Actual result

Cannot activate(confirm) the customer via WebAPI.

Additional information

See webapi.xml

    <route url="/V1/customers/me/activate" method="PUT">
        <service class="Magento\Customer\Api\AccountManagementInterface" method="activateById"/>
        <resources>
            <resource ref="self"/>
        </resources>
        <data>
            <parameter name="customerId" force="true">%customer_id%</parameter>
        </data>
    </route>

This endpoint requires resource self. Paradox: So to activate(confirm) customer, you need customer token. To get customer token, you need to activate(confirm) the customer first.

Related Customer Confirmation Bug: #39254

Release note

No response

Triage and priority

  • [ ] Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • [X] Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • [ ] Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • [ ] Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • [X] Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.

wubinworks avatar Oct 11 '24 03:10 wubinworks

Hi @wubinworks. Thank you for your report. To speed up processing of this issue, make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce.


Join Magento Community Engineering Slack and ask your questions in #github channel. :warning: According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting. :clock10: You can find the schedule on the Magento Community Calendar page. :telephone_receiver: The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.

m2-assistant[bot] avatar Oct 11 '24 03:10 m2-assistant[bot]

Hi @engcom-Bravo. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:

  • [ ] 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
  • [ ] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue.
  • [ ] 3. Add Area: XXXXX label to the ticket, indicating the functional areas it may be related to.
  • [ ] 4. Verify that the issue is reproducible on 2.4-develop branch
    Details- If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!
  • [ ] 5. Add label Issue: Confirmed once verification is complete.
  • [ ] 6. Make sure that automatic system confirms that report has been added to the backlog.

m2-assistant[bot] avatar Oct 23 '24 05:10 m2-assistant[bot]

Hi @wubinworks,

Thanks for your reporting and collaboration.

We have verified the issue in Latest 2.4-develop instance and the issue is reproducible.kindly refer the screenshots.

Create customer account via WebAPI

Screenshot 2024-10-23 at 10 44 57 Screenshot 2024-10-23 at 10 45 02

We are not able to activate(confirm) via WebAPI using confirmation key.

Hence confirming the issue.

Thanks.

engcom-Bravo avatar Oct 23 '24 05:10 engcom-Bravo

:white_check_mark: Jira issue https://jira.corp.adobe.com/browse/AC-13281 is successfully created for this GitHub issue.

github-jira-sync-bot avatar Oct 23 '24 05:10 github-jira-sync-bot

:white_check_mark: Confirmed by @engcom-Bravo. Thank you for verifying the issue.
Issue Available: @engcom-Bravo, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

m2-assistant[bot] avatar Oct 23 '24 05:10 m2-assistant[bot]

Hello @wubinworks ,

Adobe Commerce Engineering team started working on this issue. We will reach out to you if we need more information and you will get notified once the issue is fixed. Please leave comments for any further questions.

Thank you!

engcom-November avatar Nov 27 '25 11:11 engcom-November