We have an OAuth Hello World app which is a nice way of testing MediaWiki's OAuth 1 functionality. We should have something similar for OAuth 2.
Description
Related Objects
- Mentioned In
- T405648: Incorrect error message when trying to authorize an owner-only OAuth 2 client
T403487: Exploratory testing on PHP 8.3 for MediaWiki authentication stack: OAuth
T402804: Exploratory testing on PHP 8.3 for MediaWiki authentication stack - Mentioned Here
- T403487: Exploratory testing on PHP 8.3 for MediaWiki authentication stack: OAuth
Event Timeline
I think we should re-prioritize this. We have more time now, and the lack of such an app made testing OAuth 2 changes more annoying.
T403487#11154642 has some basic hello world scripts in Python (though without a GUI), for both OAuth 1 and OAuth 2.
@matmarex, please have a look and let me know what you think! I haven’t tested with a real client_id yet.
https://phabricator.wikimedia.org/F66343855
Nice, I tested it out locally and everything seems to work. I will want to spend some time reading more about OAuth 2 myself to make sure that we're doing things completely correctly. I'm hoping to do it later this week.
Some notes:
- The case 'logout': code is unused
- The action=identify endpoint gives a warning: "Unrecognized value for parameter \"uiprop\": registration" – I think it needs to be registrationdate instead
- You removed some configs and documentation, I think it would be nice to keep them. In particular, $mytalkUrl is now undefined, but still used
- You reformatted most of the code (or maybe some tool did that automatically?), which makes it a bit difficult to see the differences between the OAuth 1 and OAuth 2 versions :(
- Some of the minor changes are nice to have though, like changing the var_export to json_encode. It'd be good to do that for the OAuth 1 version too.
In the meantime, could you also:
- Set up a new tool on Toolforge, where we'll host the new app – I suppose it should be called oauth2-hello-world.
- https://wikitech.wikimedia.org/wiki/Help:Toolforge
- https://wikitech.wikimedia.org/wiki/Help:Toolforge/Quickstart
- You can add me as a co-maintainer later in https://toolsadmin.wikimedia.org/tools/
- Set up an OAuth 2 app, so that the tool can be tested against production wikis
- Set up a Git repository for this project, so we have a nicer place to discuss changes. Apparently it's recommended to host them on our GitLab these days:
I know this is a lot, let me know if you run into any trouble, or if we should meet up and talk through the details. And sorry for not getting back to you faster!
Okay! Thanks for the feedback @matmarex! I'll have those set up and let you know how it goes :)
It looks like I have to create the tool before setting up a repo for the project. I just applied for membership, and my request is still pending.