-
Notifications
You must be signed in to change notification settings - Fork 20
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
The system-wide user authentication implementation causes friction and breaks the WooCommerce REST API authentication #387
Comments
Great bug report, @mrdarrengriffin ! Thank you 😊 |
Thanks @danielbachhuber. I am going to start familarising myself with this codebase and see if I can fix it myself and make a PR but time is scarce! Thanks for acknowledging |
I couldn't manage to get a successful response from the WooCommerce REST API using API keys. As far as I checked the code, basic authentication is only enabled when using SSL (reference) which is currently unsupported in the Studio app (#191). The only method that would work is using OAuth which doesn't require SSL. Regarding the system-wide user authentication, I'm currently working on a solution to match a more common behavior. |
A first step to solve this issue has been implemented in WordPress-Playground: WordPress/wordpress-playground#1753 |
This issue will be solved in #532 🎊 . |
Quick summary
Studio handles authentication differently from the native WordPress functionality in that the session is not scoped to the browser via cookies but the entire system. This adds friction when needing to test unauthenticated logic as when going incognito, using a different browser or using Postman results in you still being authenticated.
In addition, this breaks how WooCommerce handles the REST API authentication as being authenticated bypasses the other methods of authentication (such as Basic Auth and even OAuth 1.0 via headers or GET params)
Steps to reproduce
Browser sessions:
WooCommerce API:
What you expected to happen
Authentication should only be scoped to the browser session using cookies. The implementation of the global authentication goes against the standard implementation and adds friction to how we develop and test within WordPress.
When I use Incognito, another browser or Postman, they should all be unauthenticated if not previously logged in.
A solution could be to make another must-use plugin that allows authentication using GET params that Studio app can then use within the links in the settings area. As it opens the default browser, it will not change anything about the current implementation other than that it's now scoped to that session, like normal. This will then allow Incognito sessions, other browsers and Postman requests to work independently
What actually happened
Authentication should ideally not be system-wide and still rely on browser cookies. At present, using the WooCommerce REST API is tedious as I need to logout every time I want to test a route.
Impact
All
Available workarounds?
Yes, difficult to implement
Platform
Windows
Logs or notes
No response
The text was updated successfully, but these errors were encountered: