Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SIWA] Handle Apple Credential Revoked notification #12552

Merged
merged 10 commits into from Sep 27, 2019

Conversation

@ScoutHarris
Copy link
Contributor

commented Sep 25, 2019

Fixes #12535
WPAuth PR: wordpress-mobile/WordPressAuthenticator-iOS#138

This uses the changes in WPAuth to:

  • Start and stop listening to Apple's revoked notification.
  • When received, the account is logged out.

Also, the call to check the Apple credential state is now made in applicationDidBecomeActive. This allows the check to be done when the app returns from background.


Notes:

  • This should be tested on a real device as it seems the revoked notification does not work in simulators.
  • The revoked notification is only triggered when switching apps via the app switcher.

To test the revoked notification:

  • Sign up / log in with SIWA.
  • Open app switcher (i.e. double tap the home button).
  • Select iOS Settings.
  • Disconnect your Apple account (see steps below).
  • Open app switcher (i.e. double tap the home button).
  • Select WordPress.
  • You should be logged out.
  • This log message should appear:
    Apple credentialRevokedNotification received. User signed out.

To test checking the credential state:

  • Sign up / log in with SIWA.
  • Background WordPress.
  • Go to iOS Settings.
  • Disconnect your Apple account (see steps below).
  • Return to WordPress.
  • You should be logged out.
  • This log message should appear:
    checkAppleIDCredentialState: Unauthorized Apple ID. User signed out.

Steps to disconnect in your Apple account on a device.

  • Go to iOS Settings.
  • Select your iCloud account at the top.
  • Go to Password & Security > Apps Using Your Apple ID.
  • Select WordPress > Stop Using Apple ID.

Update release notes:

  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.
Copy link
Contributor

left a comment

The code looks good to me, but I don't seem to be receiving the revoked notification 🤔

I even commented out the call because that was picking up the change as soon as I came back to the app, but still no notification. Any ideas?

@ScoutHarris ScoutHarris referenced this pull request Sep 26, 2019
1 of 1 task complete
@ScoutHarris

This comment has been minimized.

Copy link
Contributor Author

commented Sep 26, 2019

Hey @frosty .

The only thing I found is that the revoked notification doesn't seem to be triggered in simulators. I've added a note in the description. Otherwise, I am getting it when app switching.

@ScoutHarris ScoutHarris merged commit 7fea975 into develop Sep 27, 2019
6 checks passed
6 checks passed
Hound No violations found. Woof!
Peril All green. Woo!
Details
ci/circleci: Build Tests Your tests passed on CircleCI!
Details
ci/circleci: UI Tests (iPad Air 3rd generation) Your tests passed on CircleCI!
Details
ci/circleci: UI Tests (iPhone 11) Your tests passed on CircleCI!
Details
ci/circleci: Unit Tests Your tests passed on CircleCI!
Details
@ScoutHarris ScoutHarris deleted the issue/12535-siwa_handle_revoked_credential branch Sep 27, 2019
@JavonDavis JavonDavis modified the milestones: 13.4 ❄️, 13.2 ❄️ Oct 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.