Page MenuHomePhabricator

add "CommonsFinder://" custom scheme to $wgUrlProtocols for native app OAuth2 support
Closed, ResolvedPublic

Description

I would like to use OAuth2 for CommonsFinder, the iOS Commons App I am currently developing and planning a public release in the App-Store release this year.

Currently the app uses action=clientlogin, which is not ideal, especially given recent rate-limit changes and in general integration.

As the registration form (https://meta.wikimedia.org/wiki/Special:OAuthConsumerRegistration/propose/oauth2) currently only allows custom schemes defined in $wgUrlProtocols, as far as I know, and will return an error otherwise,
I am hereby applying to add following custom URL scheme to $wgUrlProtocols, in order to complete the registration form:

CommonsFinder://

This scheme will be used to handle OAuth2 redirect URLs via:

CommonsFinder://OAuthCallback

This will be processed directly in the native app to proceed with the auth flow. I will likely use the following library as the middle-layer: https://github.com/ChimeHQ/OAuthenticator

I understand that custom schemes are not lightly added to $wgUrlProtocols, but not having OAuth2 support is quite the blocker currently, and I would love to get the iOS Commons App in more people's hands this year :)
I am happy to supply you with detailed feedback regarding implementation and bugs I encounter.

PS: @Tgr I assigned you to the ticket as we interacted recently at https://commons.wikimedia.org/wiki/Commons_talk:Mobile_app#OAuth_support. Feel free to un/re-assign, or let me know if that field should be kept empty when creating tickets in the future (I don't want to overstep). :)

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Nylki updated the task description. (Show Details)
Nylki updated the task description. (Show Details)
Nylki updated the task description. (Show Details)

Change #1288953 had a related patch set uploaded (by Gergő Tisza; author: Gergő Tisza):

[operations/mediawiki-config@master] Add CommonsFinder to $wgUrlProtocols

https://gerrit.wikimedia.org/r/1288953

Change #1288953 merged by jenkins-bot:

[operations/mediawiki-config@master] Add CommonsFinder to $wgUrlProtocols

https://gerrit.wikimedia.org/r/1288953

Mentioned in SAL (#wikimedia-operations) [2026-05-19T20:08:14Z] <tgr@deploy1003> Started scap sync-world: Backport for [[gerrit:1288953|Add CommonsFinder to $wgUrlProtocols (T426614)]], [[gerrit:1289352|Remove unused ParsoidFragmentInput and ParsoidFragmentSupport]]

Mentioned in SAL (#wikimedia-operations) [2026-05-19T20:10:11Z] <tgr@deploy1003> cscott, tgr: Backport for [[gerrit:1288953|Add CommonsFinder to $wgUrlProtocols (T426614)]], [[gerrit:1289352|Remove unused ParsoidFragmentInput and ParsoidFragmentSupport]] synced to the testservers (see https://wikitech.wikimedia.org/wiki/Mwdebug). Changes can now be verified there.

Mentioned in SAL (#wikimedia-operations) [2026-05-19T20:16:39Z] <tgr@deploy1003> Finished scap sync-world: Backport for [[gerrit:1288953|Add CommonsFinder to $wgUrlProtocols (T426614)]], [[gerrit:1289352|Remove unused ParsoidFragmentInput and ParsoidFragmentSupport]] (duration: 08m 25s)

This is done. Keeping it open to revert it when the patches for T412542 land.

@Tgr thank you for the quick patch! Will test it with the registration form sometime the next couple days.

@Tgr Update: I just tried to register for a new consumer with the added scheme, but I still get the same error.
Could it be that the patch is not live yet?

Screenshot 2026-05-21 at 17.11.26.png (748×286 px, 39 KB)

The patch has been live since May 20.

URI schemes are case insensitive, but it seems like UrlUtils expects them in lowercase.

Change #1293819 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[operations/mediawiki-config@master] Fix case of 'commonsfinder' in $wgUrlProtocols

https://gerrit.wikimedia.org/r/1293819

Change #1293173 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[operations/mediawiki-config@master] Configure wgOAuthAutoApprove['protocols']

https://gerrit.wikimedia.org/r/1293173

Change #1293819 merged by jenkins-bot:

[operations/mediawiki-config@master] Fix case of 'commonsfinder' in $wgUrlProtocols

https://gerrit.wikimedia.org/r/1293819

Mentioned in SAL (#wikimedia-operations) [2026-05-27T20:56:25Z] <ebernhardson@deploy1003> Started scap sync-world: Backport for [[gerrit:1288370|Allow Vector 2022 font size changes in namespace 100 for enwiktionary (T423766)]], [[gerrit:1293819|Fix case of 'commonsfinder' in $wgUrlProtocols (T426614)]]

Mentioned in SAL (#wikimedia-operations) [2026-05-27T20:58:26Z] <ebernhardson@deploy1003> matmarex, ebernhardson, pppery: Backport for [[gerrit:1288370|Allow Vector 2022 font size changes in namespace 100 for enwiktionary (T423766)]], [[gerrit:1293819|Fix case of 'commonsfinder' in $wgUrlProtocols (T426614)]] synced to the testservers (see https://wikitech.wikimedia.org/wiki/Mwdebug). Changes can now be verified there.

Mentioned in SAL (#wikimedia-operations) [2026-05-27T21:04:03Z] <ebernhardson@deploy1003> Finished scap sync-world: Backport for [[gerrit:1288370|Allow Vector 2022 font size changes in namespace 100 for enwiktionary (T423766)]], [[gerrit:1293819|Fix case of 'commonsfinder' in $wgUrlProtocols (T426614)]] (duration: 07m 38s)

@matmarex Thanks for taking another look! It appears to be working now, the registration form accepted the input this time. :)

Change #1293173 merged by jenkins-bot:

[operations/mediawiki-config@master] Configure wgOAuthAutoApprove['protocols']

https://gerrit.wikimedia.org/r/1293173

Mentioned in SAL (#wikimedia-operations) [2026-06-15T13:11:56Z] <jforrester@deploy1003> Started scap sync-world: Backport for [[gerrit:1293173|Configure wgOAuthAutoApprove['protocols'] (T412542 T426614)]], [[gerrit:rEMFR13008731d921|jawiki: remove four rights from the eliminator group (T428942)]], [[gerrit:1301401|Deploy PRV to 6 wikis (T429038)]], [[gerrit:1300858|[abstractwiki] Set wgForceUIMsgAsContentMsg for sidebar messages (T427730)]], [[gerrit:1300872|abstractwiki: Temporary config fo

Mentioned in SAL (#wikimedia-operations) [2026-06-15T13:13:42Z] <jforrester@deploy1003> arlolra, matmarex, jforrester, dragoniez: Backport for [[gerrit:1293173|Configure wgOAuthAutoApprove['protocols'] (T412542 T426614)]], [[gerrit:rEMFR13008731d921|jawiki: remove four rights from the eliminator group (T428942)]], [[gerrit:1301401|Deploy PRV to 6 wikis (T429038)]], [[gerrit:1300858|[abstractwiki] Set wgForceUIMsgAsContentMsg for sidebar messages (T427730)]], [[gerrit:1300872|abstractwiki: Te

Mentioned in SAL (#wikimedia-operations) [2026-06-15T13:22:06Z] <jforrester@deploy1003> Finished scap sync-world: Backport for [[gerrit:1293173|Configure wgOAuthAutoApprove['protocols'] (T412542 T426614)]], [[gerrit:rEMFR13008731d921|jawiki: remove four rights from the eliminator group (T428942)]], [[gerrit:1301401|Deploy PRV to 6 wikis (T429038)]], [[gerrit:1300858|[abstractwiki] Set wgForceUIMsgAsContentMsg for sidebar messages (T427730)]], [[gerrit:1300872|abstractwiki: Temporary config f

Tgr reassigned this task from Tgr to matmarex.

@matmarex @Tgr Btw. I implemented OAuth2 support and works great. Thank you for your work!
I was/am considering using Universal Links but that also means registering and paying for a domain, potentially just for that purpose. So it's great to have the option to use a custom scheme.