Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GraphQl. Retrieve customer's shopping cart without an authorization token #28040

Closed
atwixfirster opened this issue Apr 29, 2020 · 13 comments
Closed
Assignees
Labels
Area: APIs Component: Customer Component: CustomerGraphQl Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing. Progress: done Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Severity: S0 A problem that is blocking the ability to work. An immediate fix is needed. Triage: Done Has been reviewed and prioritized during Triage with Product Managers

Comments

@atwixfirster
Copy link
Contributor

atwixfirster commented Apr 29, 2020

Preconditions (*)

  1. Sample data
  2. Login as Veronica Costello
  3. Add any product(s) into a shopping cart

Steps to reproduce (*)

  1. Copy PHPSESSID value from a browser window

27373-01

  1. Set PHPSESSID in a header

27373-02

  1. Run the next GraphQL query to retrieve a customer's cart
{
  cart(cart_id: "kSjlU0dTeaH9CUuaRGFSUTOejwTN9ZLn") {
    id
    items {
      id
      quantity
      product {
        sku
      }
    }
  }
}

Expected result (*)

  1. GraphQl should use an Authorization token (Bearer) ONLY to retrieve a customer's cart.

27373-04

Actual result (*)

  1. Guest sees products which customer has been added into shopping cart.

27373-03

@m2-assistant
Copy link

m2-assistant bot commented Apr 29, 2020

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

@magento-engcom-team magento-engcom-team added the Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed label Apr 29, 2020
@atwixfirster
Copy link
Contributor Author

Fix provided in #27373

@m2-assistant
Copy link

m2-assistant bot commented Apr 29, 2020

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

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).

    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.

  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

  • 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • 4. Verify that the issue is reproducible on 2.4-develop branch

    Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
    - 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.

@dmytro-ch dmytro-ch added Component: Customer Component: CustomerGraphQl Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed labels Apr 29, 2020
@sdzhepa sdzhepa added Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing. Severity: S1 Affects critical data or functionality and forces users to employ a workaround. Triage: Done Has been reviewed and prioritized during Triage with Product Managers labels Apr 29, 2020
@ghost ghost assigned atwixfirster and unassigned atwixfirster Apr 30, 2020
@lenaorobei
Copy link
Contributor

Confirmed with PO that is was a requirement to support both - token and session.
Sorry, but I need to close this issue.

@slavvka
Copy link
Member

slavvka commented Jun 5, 2020

Hi @atwixfirster. Thank you for your report.
The issue has been fixed in #27373 by @atwixfirster in 2.4-develop branch
Related commit(s):

The fix will be available with the upcoming 2.4.1 release.

@slavvka slavvka added the Fixed in 2.4.x The issue has been fixed in 2.4-develop branch label Jun 5, 2020
@jesse-deboer
Copy link

jesse-deboer commented Jan 21, 2022

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:
#35004

@atwixfirster
Copy link
Contributor Author

atwixfirster commented Jan 21, 2022

Now it's not possible to combine GraphQL calls that need a bearer token with basic-auth for 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

@sdzhepa sdzhepa reopened this Jan 27, 2022
@engcom-Hotel engcom-Hotel added Component: Customer Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed labels Feb 1, 2022
@github-jira-sync-bot
Copy link

✅ Jira issue https://jira.corp.magento.com/browse/AC-2244 is successfully created for this GitHub issue.

@m2-assistant
Copy link

m2-assistant bot commented Feb 1, 2022

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

@cpartica cpartica added Severity: S0 A problem that is blocking the ability to work. An immediate fix is needed. and removed Severity: S1 Affects critical data or functionality and forces users to employ a workaround. labels Feb 8, 2022
@cpartica
Copy link
Contributor

cpartica commented Feb 8, 2022

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 magento deleted a comment from github-jira-sync-bot Mar 1, 2022
@github-jira-sync-bot github-jira-sync-bot added Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing. and removed Priority: P2 A defect with this priority could have functionality issues which are not to expectations. labels Aug 10, 2022
@engcom-Lima
Copy link
Contributor

@magento give me 2.4-develop instance

@magento-deployment-service
Copy link

Hi @engcom-Lima. Thank you for your request. I'm working on Magento instance for you.

@magento-deployment-service
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: APIs Component: Customer Component: CustomerGraphQl Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing. Progress: done Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Severity: S0 A problem that is blocking the ability to work. An immediate fix is needed. Triage: Done Has been reviewed and prioritized during Triage with Product Managers
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.