OAuthSwift icon indicating copy to clipboard operation
OAuthSwift copied to clipboard

Canceling Apple ID isn't handled

Open richardpineo opened this issue 3 years ago • 0 comments

Description:

This one is a little difficult to explain, so bear with me.

We use Azure B2C to handle authentication and OAuthSwift to handle that communication. Everything works great and has for quite some time.

Recently, we updated our B2C configuration to use Apple ID for some customers. However, instead of redirecting to a web site that allows the user to enter username/password, iOS brings up a specialized / native Apple ID view. This works great if the user successfully authenticates.

However, if the user cancels out of that process, then OAuthSwift never gets the memo and will basically hang forever since it never got a notification that the Auth flow was canceled.

I spent a long time trying to hook the Apple ID cancel message, but couldn't figure out how to do it. You can detect that the scene has resigned active but that isn't enough information to meaningfully act upon because other actions (like an incoming phone call or more importantly FaceID to access stored passwords) will also generate that scenario.

This issue is described in this stackoverflow: https://stackoverflow.com/questions/70130072/cannot-detect-if-user-pressed-cancel-button-on-wkwebview-sign-in-with-apple-pop

I have no idea what to try next - it seems to me that OAuthSwift should be able to detect the user cancelling out of the Apple ID auth just like it does when the user cancel's out of any IDP shown in the browser window.

This is what the native Apple ID screen looks like on an iPad: image

OAuth Provider? (Twitter, Github, ..):

Azure / Apple ID

OAuth Version:

  • [ ] Version 1
  • [x] Version 2

OS (Please fill the version) :

  • [x] iOS :
  • [ ] OSX :
  • [ ] TVOS :
  • [ ] WatchOS :

Installation method:

  • [ ] Carthage
  • [x] CocoaPods
  • [ ] Swift Package Manager
  • [ ] Manually

Library version:

  • [ ] head
  • [ ] v2.1.0
  • [ ] v2.0.0
  • [ ] v1.4.1
  • [x] other: (v2.2.0)

Xcode version:

  • [ ] 11.4 (Swift 5.2)
  • [ ] 11.x (Swift 5.1)
  • [ ] 10.x (Swift 5.0)
  • [x] other: (13.4.1)
  • [ ] objective c

richardpineo avatar Jun 09 '22 16:06 richardpineo