Steps to replicate:
- go to https://meta.wikimedia.org/wiki/Special:OAuthConsumerRegistration/propose/oauth2 , create an app with the "Client credentials" grant and otherwise default settings (callback URL can be arbitrary)
- go to https://meta.wikimedia.org/wiki/Special:RestSandbox#/default/post_oauth2_access_token , select client credentials grant, copy the client id, secret and callback URL (as redirect URI) and submit
- test the resulting access token, e.g. with curl -H 'Authorization: Bearer <access token>' 'https://www.mediawiki.org/w/api.php?format=json&action=query&meta=userinfo'
The access token will work (an invalid access token would result in an API error) but you will be the anonymous user.
Might or might not be related to T407655: Document how access tokens with an oaac_id of 0 are used.