magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.58k stars 9.32k forks source link

[WebAPI] customer email confirmation via WebAPI paradox #39255

Open wubinworks opened 1 month ago

wubinworks commented 1 month ago

Preconditions and environment

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

m2-assistant[bot] commented 1 month ago

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.

m2-assistant[bot] commented 1 month ago

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:

engcom-Bravo commented 1 month ago

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.

github-jira-sync-bot commented 1 month ago

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

m2-assistant[bot] commented 1 month ago

: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.