Enable support to login with two factor code #3980
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Please include a summary of the change and include the related jira issue if it exists.
No Jira issue for this. Just an external contribution from EyeSeeTea.
Solution description
This PR enables the use of 2FA in servers above v41. It depends on this PR SDK side.
When a user activates 2FA the app will detect the failure produced by a login attempt on a 2FA-enabled user and will add a field asking for 2FA code to that user.
The 2FA requires the cookie to be present after that login. So when the login expires (this is e.g. when its been a while since the user didn't login) the sync attemps will fail. It is important to note that, effectively, this means that when a user activates its 2FA, the user needs to be trained in the different from a sync perspective, as the app will only sync its metadata/data after a login is done. It's then important that the user knows that without a login, the data that was not synced won't be synced to the server before the next login.
Covered unit test cases
Describe the tests that you ran to verify your changes.
Where did you test this issue?
Which Android versions did you test this issue?
Checklist