[GH-ISSUE #700] Canceling Apple ID isn't handled #453

Open
opened 2026-03-03 16:48:46 +03:00 by kerem · 0 comments
Owner

Originally created by @richardpineo on GitHub (Jun 9, 2022).
Original GitHub issue: https://github.com/OAuthSwift/OAuthSwift/issues/700

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
  • Version 2

OS (Please fill the version) :

  • iOS :
  • OSX :
  • TVOS :
  • WatchOS :

Installation method:

  • Carthage
  • CocoaPods
  • Swift Package Manager
  • Manually

Library version:

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

Xcode version:

  • 11.4 (Swift 5.2)
  • 11.x (Swift 5.1)
  • 10.x (Swift 5.0)
  • other: (13.4.1)
  • objective c
Originally created by @richardpineo on GitHub (Jun 9, 2022). Original GitHub issue: https://github.com/OAuthSwift/OAuthSwift/issues/700 ### 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](https://user-images.githubusercontent.com/8593979/172898575-18c75e62-daa4-4505-8707-dadb1c3c8806.png) ### 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
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/OAuthSwift#453
No description provided.