One (or more) mediawiki maintenance scripts.
I think in an ideal world this would be part of the OAuth extension.
It takes the same parameters as Propose Consumer (see: https://meta.wikimedia.org/wiki/Special:OAuthConsumerRegistration/propose) as well as the user
It can approve consumers see SpecialMWOAuthManageConsumers
It outputs to standard out: