Conversation
- Organized GraphQL-related proposals - Updated README.md to reflect current situation
|
Pending additional scenarios from @naydav |
- Documented existing GraphQL schema for customer
- Introduced `country` field in `CustomerAddress` to be able to fetch country name from the customer address - Deprecated `region_id` and `country_code`
|
Might want to add a note that this feature is only added to the B2B schema |
|
@DrewML it is mentioned that there is a dependency on |
because apparently it's not 😂 |
|
A few things from my side,
|
@DrewML |
|
This feature has some security risks associated with it, that I think we should reconsider. With the design of this feature, it seems like a headless UI (like pwa-studio) would use it in the following way:
My concern is around the second step here. We should never be passing sensitive information like an admin token in a URL, as it'll end up in web logs/referrer headers/etc. Anyone that gets control of that admin token would then have the same level of access that the admin had, for as long as the session remains valid. If we need to, from the admin, establish a session with that user in the headless application, there are patterns to do this that limit exposure to sensitive data/account takeover. One approach is:
|
Interesting! I was going off the project overview from the Product Team in Confluence:
There's also the note from @mbrinton01 in B2B-221:
The devdocs linked also have "Login as Customer logging" as a Commerce only feature, but seems like logging was implemented in Open-Source. Can you clarify if we changed this requirement somewhere? Just very confused 😅 |
|
From the security team's perspective, I agree with @DrewML here. When it comes to authentication workflows, there is no need to completely reinvent our own mechanism when there are many well-documented and reviewed workflows. On that note, the workflow that @DrewML already described is very similar to how one of the oauth workflows function. I would recommend to stick as closely to the oauth handshake as possible since it addresses all the concerns listed here. It isn't 100% identical but the relevant portion can be used. Of course, the full oauth workflow described in the rfc is a little more than needed here because we aren't dealing with multiple apps and different scopes and permission types. However, the heart of the workflow is definitely still relevant. That said, here is what it would roughly look like using the oauth 2 authorization code workflow rfc 6749 section 1.3.1.
💡 We can mitigate this small risk by
ℹ️ We could potentially use the admin username/password in the request as the shared secret but I don't think it would be ideal from a UI/UX view to prompt the admin again for their credentials on the storefront although it would eliminate the issue. |
|
The bullet point quoted above is the answer to a question about admin permissions, not the overall feature. This feature is available in both Open Source and Commerce.
Mark
From: Andrew Levine <notifications@github.com>
Reply-To: magento/architecture <reply@reply.github.com>
Date: Monday, August 17, 2020 at 4:24 PM
To: magento/architecture <architecture@noreply.github.com>
Cc: Mark Brinton <mbrinton@adobe.com>, Mention <mention@noreply.github.com>
Subject: Re: [magento/architecture] Login as customer (#414)
No, in general, it's CE feature
I'm going off project overview from the Product Team in Confluence:
We believe that introducing the capability sales Rep to login as customer, for B2B Sales Representative , we will satisfy a basic need during and after the B2B shopping experience . We will know this to be true when we see merchants using this feature actively.
There's also the note from @mbrinton01<https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmbrinton01&data=02%7C01%7Cmbrinton%40adobe.com%7Caeb74127ab484fae5fd508d842f3dd77%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637332962448761639&sdata=rLNBYZ5UrEFLGaGGU8t9UD8PQIBFr2a2GArL4TB3noE%3D&reserved=0> in B2B-221:
This feature does apply across B2B and B2C. It should be present in Commerce but does not need to be in Open Source.
Can you clarify if we changed this requirement somewhere?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmagento%2Farchitecture%2Fpull%2F414%23issuecomment-675123051&data=02%7C01%7Cmbrinton%40adobe.com%7Caeb74127ab484fae5fd508d842f3dd77%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637332962448771632&sdata=TD2%2BV%2FGEkuS7VKdxLvBUBhEVJ7Y9N0wllYNIGhz2exw%3D&reserved=0>, or unsubscribe<https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FACRESEBA3XMWZTJEAHYWBOLSBGNXHANCNFSM4PUUAGKA&data=02%7C01%7Cmbrinton%40adobe.com%7Caeb74127ab484fae5fd508d842f3dd77%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637332962448771632&sdata=PBZOVm7vzeMGRXXaJjNP%2FNi0fpxCkhhvw8b2EzOBifU%3D&reserved=0>.
|
|
I would suggest trying a more simple approach that would work for REST as well - create a REST endpoint that would generate customer token for an admin, then use the token same as you would've used a regular customer token for REST and GraphQL web APIs |
This poses the same level of risk - getting that admin-generated token to the headless front-end (from the admin UI) would require passing it via the URL in a GET (browser navigation). Any token passed via URL should be short lived and have minimal permissions |
|
REST/SOAP/GraphQL it doesn't matter. There will need to a new way to exchange an authorization code (from the described workflow) for an admin token. It doesn't eliminate the need for the authorization code or the exchange. |
Co-authored-by: Andrew Levine <DrewML@users.noreply.github.com>
|
@paliarush I can't figure out the reason why headless Magento clients would have to pass customer token issue for an admin via URL, can you help? |
MC-36365: GraphQL schema for B2B purchase order
nathanjosiah
left a comment
There was a problem hiding this comment.
Updated token exchange text looks good
Requriements
As a developer, I want to create a flexible login as a customer schema that can be added to the graph so a merchant or merchant admin can log into an end customer's account to assist them with their account.
Additional Changes