magento2
magento2 copied to clipboard
GraphQl. Retrieve customer's shopping cart without an authorization token
Preconditions (*)
- Sample data
- Login as
Veronica Costello - Add any product(s) into a shopping cart
Steps to reproduce (*)
- Copy
PHPSESSIDvalue from a browser window
- Set
PHPSESSIDin a header
- Run the next GraphQL query to retrieve a customer's cart
{
cart(cart_id: "kSjlU0dTeaH9CUuaRGFSUTOejwTN9ZLn") {
id
items {
id
quantity
product {
sku
}
}
}
}
Expected result (*)
- GraphQl should use an Authorization token (
Bearer) ONLY to retrieve a customer's cart.
Actual result (*)
- Guest sees products which customer has been added into shopping cart.
Hi @atwixfirster. Thank you for your report. To help us process this issue please make sure that you provided the following information:
- [ ] Summary of the issue
- [ ] Information on your environment
- [ ] Steps to reproduce
- [ ] Expected and actual results
Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:
@magento give me 2.4-develop instance - upcoming 2.4.x release
For more details, please, review the Magento Contributor Assistant documentation.
@atwixfirster do you confirm that you were able to reproduce the issue on vanilla Magento instance following steps to reproduce?
- [ ] yes
- [ ] no
- Join Magento Community Engineering Slack and ask your questions in #github channel.
Fix provided in https://github.com/magento/magento2/pull/27373
Hi @dmytro-ch. 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:
-
[x] 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
Details
If the issue has a valid description, the labelIssue: Format is validwill be added to the issue automatically. Please, edit issue description if needed, until labelIssue: Format is validappears. -
[x] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add
Issue: Clear Descriptionlabel to the issue by yourself. -
[x] 3. Add
Component: XXXXXlabel(s) to the ticket, indicating the components it may be related to. -
[ ] 4. Verify that the issue is reproducible on
2.4-developbranchDetails
- Add the comment@magento give me 2.4-develop instanceto deploy test instance on Magento infrastructure.
- If the issue is reproducible on2.4-developbranch, please, add the labelReproduced 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: Confirmedonce verification is complete. -
[ ] 6. Make sure that automatic system confirms that report has been added to the backlog.
Confirmed with PO that is was a requirement to support both - token and session. Sorry, but I need to close this issue.
Hi @atwixfirster. Thank you for your report. The issue has been fixed in magento/magento2#27373 by @atwixfirster in 2.4-develop branch Related commit(s):
The fix will be available with the upcoming 2.4.1 release.
Hi @slavvka, why is this fixed as a bug while @lenaorobei confirmed this was a requirement?
I think the issue was that the PWA and Magento shouldn't be in the same root folder. Deleting this functionality for all Magento users to fix something for someone who installed PWA and Magento in the same folder should not be the way to go. I think @atwixfirster should change his cookie path and it would be fixed in that way while leaving the functionality for using the Session ID.
Now it's not possible to combine GraphQL calls that need a bearer token with basic-auth for a staging environment, right?
I made a PR to put back this functionality: https://github.com/magento/magento2/pull/35004
Now it's not possible to combine GraphQL calls that need a
bearertoken withbasic-authfor a staging environment, right?
Hi, @jesse-deboer !
We used Bearer with enabled Basic Auth without any issues.
And yes, @lenaorobei has provided the expected result here, so I believe your PR is correct one.
Thanks
:white_check_mark: Jira issue https://jira.corp.magento.com/browse/AC-2244 is successfully created for this GitHub issue.
:white_check_mark: Confirmed by @engcom-Hotel. Thank you for verifying the issue.
Issue Available: @engcom-Hotel, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.
The way GQL works now is that we support both Session and Token - any would count for accessing authenticated content. It is the product intention to phase out "session" support, but there are two problems with this:
- one is that since it's supported, there are clients that depend on it
- removing sessions (and we have tried) caused misbehavior of some capabilities that gathered their data from the actual session like "Tax".
@magento give me 2.4-develop instance
Hi @engcom-Lima. Thank you for your request. I'm working on Magento instance for you.
Hi @engcom-Lima, here is your Magento Instance: https://5f73f7470fe7be8f2ce3f53d2a3e701f.instances.magento-community.engineering Admin access: https://5f73f7470fe7be8f2ce3f53d2a3e701f.instances.magento-community.engineering/admin_09e8 Login: 4b31d6a5 Password: 7656033af129