Steps to replicate the issue (include links if applicable):
- Navigate to https://meta.wikimedia.org/wiki/Special:OAuthConsumerRegistration/propose/oauth2
- Create a new consumer
- Select User identity verification only, no ability to read pages or act on a user's behalf.
- Add the client ID and secret to the tool (see https://meta.wikimedia.org/wiki/Special:OAuthListConsumers/view/ae9667d8d02cc78cc370d014a396dc64 for the one that ended up causing problems)
Use the following code:https://gitlab.wikimedia.org/toolforge-repos/link-dispenser/-/blob/d34e3e39b37b71251e7ec7726c473aa9c1691135/auth.py to authenticate and retrieve data about the user
What happens?:
At the step where a request is made to the following URL: https://meta.wikimedia.org/w/rest.php/oauth2/resource/profile
I got back the following request text:
<!DOCTYPE html>
<html><head><title>Internal error - Meta-Wiki</title><meta name="color-scheme" content="light dark" /><style>body { font-family: sans-serif; margin: 0; padding: 0.5em 2em; }</style></head><body>
<div class="cdx-message--error cdx-message cdx-message--block"><span class="cdx-message__icon"></span><div class="cdx-message__content">[10cf4ec5-4f8e-49e3-ba8a-525febc9da25] 2026-03-20 02:17:16: Fatal exception of type "TypeError"</div></div><!-- Set $wgShowExceptionDetails = true; at the bottom of LocalSettings.php to show detailed debugging information. --></body></html>Looking at the request on Logstash, I get the following traceback:
from /srv/mediawiki/php-1.46.0-wmf.20/extensions/OAuth/src/ResourceServer.php(113)
#0 /srv/mediawiki/php-1.46.0-wmf.20/extensions/OAuth/src/SessionProvider.php(151): MediaWiki\Extension\OAuth\ResourceServer->getScopes()
#1 /srv/mediawiki/php-1.46.0-wmf.20/includes/Session/SessionManager.php(568): MediaWiki\Extension\OAuth\SessionProvider->provideSessionInfo(MediaWiki\Request\WebRequest)
#2 /srv/mediawiki/php-1.46.0-wmf.20/includes/Session/SessionManager.php(137): MediaWiki\Session\SessionManager->getSessionInfoForRequest(MediaWiki\Request\WebRequest)
#3 /srv/mediawiki/php-1.46.0-wmf.20/includes/Request/WebRequest.php(861): MediaWiki\Session\SessionManager->getSessionForRequest(MediaWiki\Request\WebRequest)
#4 /srv/mediawiki/php-1.46.0-wmf.20/includes/Setup.php(504): MediaWiki\Request\WebRequest->getSession()
#5 /srv/mediawiki/php-1.46.0-wmf.20/includes/WebStart.php(73): require_once(string)
#6 /srv/mediawiki/php-1.46.0-wmf.20/rest.php(18): require(string)
#7 /srv/mediawiki/w/rest.php(3): require(string)
#8 {main}What should have happened instead?:
Not that? Based on the text of what I selected, I should definitely be able to lookup atleast the username of the user I am authenticating. Additionally I definitely shouldn't be causing a production error.