Page MenuHomePhabricator

2FA logon doesn’t work on the iOS app
Closed, ResolvedPublic

Description

The box to enter the 2FA code doesn’t seem to actually appear... just the error message (will attach a screenshot)

Version: 6.3.0 (1643) - TestFlight Beta

Event Timeline

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

Is there something we can do to add (automated) testing for this, or making sure part of the QA of the releases, that this actually works in both versions?

@Reedy yes, we can add automated testing for this. Is there a way to create accounts with 2FA enabled on the beta cluster? nevermind, found out how to do this

@Reedy it looks like the iOS and Android apps are both looking for a request with id equal to TOTPAuthenticationRequest in the response and that string changed to MediaWiki\Extension\OATHAuth\Auth\TOTPAuthenticationRequest - is this expected?

For future reference, here's the original 2FA ticket:

T150699

@JoeWalsh Due to refactoring and moving towards namespaced classes

MediaWiki\Extension\OATHAuth\Auth\TOTPAuthenticationRequest

class name is expected.
No refactoring was done (from our side) on Wikipedia apps

Please let me know if i can help in any way

@JoeWalsh Due to refactoring and moving towards namespaced classes

MediaWiki\Extension\OATHAuth\Auth\TOTPAuthenticationRequest

class name is expected.
No refactoring was done (from our side) on Wikipedia apps

Please let me know if i can help in any way

Ugh. Partially my fault then too.

@ItSpiderman I think this is definitely worthy of a post to both wikitech-l and mediawiki-l to inform people of the breaking change in output for the extension

Sent a mail to both lists
Edit: well I guess i cannot send mails right after subscribing to the lists. I will try again later, or someone else can send the mail

@Reedy in the future, should the apps rely on the fields in the response rather than the id? Could there be a separate field type (instead of string) for 2FA to allow for only numerical input?

I am wondering why the "id" is an actual PHP class name, rather than a "real" id, like totp, which chould just be provided by the PHP class and therefore would not change in such cases.

I am wondering why the "id" is an actual PHP class name, rather than a "real" id, like totp, which chould just be provided by the PHP class and therefore would not change in such cases.

Does this code come from AuthManager rather than the OATHAuth extension?

As far as I can tell, yes. It is part of the response of a call to the clientlogin action API (https://github.com/wikimedia/apps-android-wikipedia/blob/91db452cd50960dc4b1146492dddf23d651bfdcb/app/src/main/java/org/wikipedia/login/LoginClient.java#L212). And that again just outputs stuff from AuthManager. I am not aware of any code inside Extension:OATHAuth that would publish this information directly.

[08:03:04] <Reedy> tgr: If you're bored... https://phabricator.wikimedia.org/T228588 class refactoring in OATHAuth broke 2FA in both our mobile apps
[08:03:31] <Reedy> Being questioned about whether the way/stuff we're exposing in clientlogin from authmanager is "right" or we could/should do soemthing else
[08:04:17] <tgr> you can provide a custom ID if you want
[08:04:47] <Reedy> which I guess is the answer to
[08:04:47] <Reedy> >I am wondering why the "id" is an actual PHP class name, rather than a "real" id, like totp, which chould just be provided by the PHP class and therefore would not change in such cases.
[08:05:01] <tgr> we haven't really though about clients wanting to depend on a specific ID, the vision was more about clients using the API to get the definitions for some form builder
[08:06:46] <tgr> there's AuthenticationRequest::getUniqueId(), although the original intent was to support use cases where you can have multiple instances of the same class (e.g. GoogleLogin where there are multiple Google accounts connected to the user) but there is no harm in using it to provide a fixed string
[08:06:54] <tgr> or fake the old value or whatever

2 months in and this is still not released for Android - is this being tracked for release somewhere?

2 months in and this is still not released for Android - is this being tracked for release somewhere?

It has been released for Android. See T227925.

2 months in and this is still not released for Android - is this being tracked for release somewhere?

It has been released for Android. See T227925.

No, it's not :( It was there for a period of time before it got removed again.

2 months in and this is still not released for Android - is this being tracked for release somewhere?

It has been released for Android. See T227925.

I think we're waiting for https://github.com/wikimedia/apps-android-wikipedia/commit/361e389dfd62cc65cf40e5e13b13289c6b51ed89 to appear in a public release