PhoneAuthProvider.swift 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531
  1. // Copyright 2023 Google LLC
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. import FirebaseCore
  15. import Foundation
  16. /**
  17. @brief A concrete implementation of `AuthProvider` for phone auth providers.
  18. This class is available on iOS only.
  19. */
  20. @available(iOS 13, tvOS 13, macOS 10.15, macCatalyst 13, watchOS 7, *)
  21. @objc(FIRPhoneAuthProvider) open class PhoneAuthProvider: NSObject {
  22. @objc public static let id = "phone"
  23. #if os(iOS)
  24. /**
  25. @brief Returns an instance of `PhoneAuthProvider` for the default `Auth` object.
  26. */
  27. @objc(provider) open class func provider() -> PhoneAuthProvider {
  28. return PhoneAuthProvider(auth: Auth.auth())
  29. }
  30. /**
  31. @brief Returns an instance of `PhoneAuthProvider` for the provided `Auth` object.
  32. @param auth The auth object to associate with the phone auth provider instance.
  33. */
  34. @objc(providerWithAuth:)
  35. open class func provider(auth: Auth) -> PhoneAuthProvider {
  36. return PhoneAuthProvider(auth: auth)
  37. }
  38. /**
  39. @brief Starts the phone number authentication flow by sending a verification code to the
  40. specified phone number.
  41. @param phoneNumber The phone number to be verified.
  42. @param uiDelegate An object used to present the SFSafariViewController. The object is retained
  43. by this method until the completion block is executed.
  44. @param completion The callback to be invoked when the verification flow is finished.
  45. @remarks Possible error codes:
  46. + `AuthErrorCodeCaptchaCheckFailed` - Indicates that the reCAPTCHA token obtained by
  47. the Firebase Auth is invalid or has expired.
  48. + `AuthErrorCodeQuotaExceeded` - Indicates that the phone verification quota for this
  49. project has been exceeded.
  50. + `AuthErrorCodeInvalidPhoneNumber` - Indicates that the phone number provided is
  51. invalid.
  52. + `AuthErrorCodeMissingPhoneNumber` - Indicates that a phone number was not provided.
  53. */
  54. @objc(verifyPhoneNumber:UIDelegate:completion:)
  55. open func verifyPhoneNumber(_ phoneNumber: String,
  56. uiDelegate: AuthUIDelegate? = nil,
  57. completion: ((_: String?, _: Error?) -> Void)?) {
  58. verifyPhoneNumber(phoneNumber,
  59. uiDelegate: uiDelegate,
  60. multiFactorSession: nil,
  61. completion: completion)
  62. }
  63. /**
  64. @brief Verify ownership of the second factor phone number by the current user.
  65. @param phoneNumber The phone number to be verified.
  66. @param uiDelegate An object used to present the SFSafariViewController. The object is retained
  67. by this method until the completion block is executed.
  68. @param multiFactorSession A session to identify the MFA flow. For enrollment, this identifies the user
  69. trying to enroll. For sign-in, this identifies that the user already passed the first
  70. factor challenge.
  71. @param completion The callback to be invoked when the verification flow is finished.
  72. */
  73. @objc(verifyPhoneNumber:UIDelegate:multiFactorSession:completion:)
  74. open func verifyPhoneNumber(_ phoneNumber: String,
  75. uiDelegate: AuthUIDelegate? = nil,
  76. multiFactorSession: MultiFactorSession? = nil,
  77. completion: ((_: String?, _: Error?) -> Void)?) {
  78. guard AuthWebUtils.isCallbackSchemeRegistered(forCustomURLScheme: callbackScheme,
  79. urlTypes: auth.mainBundleUrlTypes) else {
  80. fatalError(
  81. "Please register custom URL scheme \(callbackScheme) in the app's Info.plist file."
  82. )
  83. }
  84. kAuthGlobalWorkQueue.async {
  85. Task {
  86. do {
  87. let verificationID = try await self.internalVerify(
  88. phoneNumber: phoneNumber,
  89. uiDelegate: uiDelegate,
  90. multiFactorSession: multiFactorSession
  91. )
  92. Auth.wrapMainAsync(callback: completion, withParam: verificationID, error: nil)
  93. } catch {
  94. Auth.wrapMainAsync(callback: completion, withParam: nil, error: error)
  95. }
  96. }
  97. }
  98. }
  99. /**
  100. @brief Verify ownership of the second factor phone number by the current user.
  101. @param phoneNumber The phone number to be verified.
  102. @param uiDelegate An object used to present the SFSafariViewController. The object is retained
  103. by this method until the completion block is executed.
  104. @param multiFactorSession A session to identify the MFA flow. For enrollment, this identifies the user
  105. trying to enroll. For sign-in, this identifies that the user already passed the first
  106. factor challenge.
  107. @returns The verification ID
  108. */
  109. @available(iOS 13, tvOS 13, macOS 10.15, watchOS 8, *)
  110. open func verifyPhoneNumber(_ phoneNumber: String,
  111. uiDelegate: AuthUIDelegate? = nil,
  112. multiFactorSession: MultiFactorSession? = nil) async throws
  113. -> String {
  114. return try await withCheckedThrowingContinuation { continuation in
  115. self.verifyPhoneNumber(phoneNumber,
  116. uiDelegate: uiDelegate,
  117. multiFactorSession: multiFactorSession) { result, error in
  118. if let error {
  119. continuation.resume(throwing: error)
  120. } else if let result {
  121. continuation.resume(returning: result)
  122. }
  123. }
  124. }
  125. }
  126. /**
  127. @brief Verify ownership of the second factor phone number by the current user.
  128. @param multiFactorInfo The phone multi factor whose number need to be verified.
  129. @param uiDelegate An object used to present the SFSafariViewController. The object is retained
  130. by this method until the completion block is executed.
  131. @param multiFactorSession A session to identify the MFA flow. For enrollment, this identifies the user
  132. trying to enroll. For sign-in, this identifies that the user already passed the first
  133. factor challenge.
  134. @param completion The callback to be invoked when the verification flow is finished.
  135. */
  136. @objc(verifyPhoneNumberWithMultiFactorInfo:UIDelegate:multiFactorSession:completion:)
  137. open func verifyPhoneNumber(with multiFactorInfo: PhoneMultiFactorInfo,
  138. uiDelegate: AuthUIDelegate? = nil,
  139. multiFactorSession: MultiFactorSession?,
  140. completion: ((_: String?, _: Error?) -> Void)?) {
  141. multiFactorSession?.multiFactorInfo = multiFactorInfo
  142. verifyPhoneNumber(multiFactorInfo.phoneNumber,
  143. uiDelegate: uiDelegate,
  144. multiFactorSession: multiFactorSession,
  145. completion: completion)
  146. }
  147. @available(iOS 13, tvOS 13, macOS 10.15, watchOS 8, *)
  148. open func verifyPhoneNumber(with multiFactorInfo: PhoneMultiFactorInfo,
  149. uiDelegate: AuthUIDelegate? = nil,
  150. multiFactorSession: MultiFactorSession?) async throws -> String {
  151. return try await withCheckedThrowingContinuation { continuation in
  152. self.verifyPhoneNumber(with: multiFactorInfo,
  153. uiDelegate: uiDelegate,
  154. multiFactorSession: multiFactorSession) { result, error in
  155. if let error {
  156. continuation.resume(throwing: error)
  157. } else if let result {
  158. continuation.resume(returning: result)
  159. }
  160. }
  161. }
  162. }
  163. /**
  164. @brief Creates an `AuthCredential` for the phone number provider identified by the
  165. verification ID and verification code.
  166. @param verificationID The verification ID obtained from invoking
  167. verifyPhoneNumber:completion:
  168. @param verificationCode The verification code obtained from the user.
  169. @return The corresponding phone auth credential for the verification ID and verification code
  170. provided.
  171. */
  172. @objc(credentialWithVerificationID:verificationCode:)
  173. open func credential(withVerificationID verificationID: String,
  174. verificationCode: String) -> PhoneAuthCredential {
  175. return PhoneAuthCredential(withProviderID: PhoneAuthProvider.id,
  176. verificationID: verificationID,
  177. verificationCode: verificationCode)
  178. }
  179. private func internalVerify(phoneNumber: String,
  180. uiDelegate: AuthUIDelegate?,
  181. multiFactorSession: MultiFactorSession? = nil) async throws
  182. -> String? {
  183. guard phoneNumber.count > 0 else {
  184. throw AuthErrorUtils.missingPhoneNumberError(message: nil)
  185. }
  186. guard let manager = auth.notificationManager else {
  187. throw AuthErrorUtils.notificationNotForwardedError()
  188. }
  189. guard await manager.checkNotificationForwarding() else {
  190. throw AuthErrorUtils.notificationNotForwardedError()
  191. }
  192. return try await verifyClAndSendVerificationCode(toPhoneNumber: phoneNumber,
  193. retryOnInvalidAppCredential: true,
  194. multiFactorSession: multiFactorSession,
  195. uiDelegate: uiDelegate)
  196. }
  197. /** @fn
  198. @brief Starts the flow to verify the client via silent push notification.
  199. @param retryOnInvalidAppCredential Whether of not the flow should be retried if an
  200. AuthErrorCodeInvalidAppCredential error is returned from the backend.
  201. @param phoneNumber The phone number to be verified.
  202. @param callback The callback to be invoked on the global work queue when the flow is
  203. finished.
  204. */
  205. private func verifyClAndSendVerificationCode(toPhoneNumber phoneNumber: String,
  206. retryOnInvalidAppCredential: Bool,
  207. uiDelegate: AuthUIDelegate?) async throws
  208. -> String? {
  209. let codeIdentity = try await verifyClient(withUIDelegate: uiDelegate)
  210. let request = SendVerificationCodeRequest(phoneNumber: phoneNumber,
  211. codeIdentity: codeIdentity,
  212. requestConfiguration: auth
  213. .requestConfiguration)
  214. do {
  215. let response = try await AuthBackend.call(with: request)
  216. return response.verificationID
  217. } catch {
  218. return try await handleVerifyErrorWithRetry(error: error,
  219. phoneNumber: phoneNumber,
  220. retryOnInvalidAppCredential: retryOnInvalidAppCredential,
  221. multiFactorSession: nil,
  222. uiDelegate: uiDelegate)
  223. }
  224. }
  225. /** @fn
  226. @brief Starts the flow to verify the client via silent push notification.
  227. @param retryOnInvalidAppCredential Whether of not the flow should be retried if an
  228. AuthErrorCodeInvalidAppCredential error is returned from the backend.
  229. @param phoneNumber The phone number to be verified.
  230. @param callback The callback to be invoked on the global work queue when the flow is
  231. finished.
  232. */
  233. private func verifyClAndSendVerificationCode(toPhoneNumber phoneNumber: String,
  234. retryOnInvalidAppCredential: Bool,
  235. multiFactorSession session: MultiFactorSession?,
  236. uiDelegate: AuthUIDelegate?) async throws
  237. -> String? {
  238. if let settings = auth.settings,
  239. settings.isAppVerificationDisabledForTesting {
  240. let request = SendVerificationCodeRequest(
  241. phoneNumber: phoneNumber,
  242. codeIdentity: CodeIdentity.empty,
  243. requestConfiguration: auth.requestConfiguration
  244. )
  245. let response = try await AuthBackend.call(with: request)
  246. return response.verificationID
  247. }
  248. guard let session else {
  249. return try await verifyClAndSendVerificationCode(
  250. toPhoneNumber: phoneNumber,
  251. retryOnInvalidAppCredential: retryOnInvalidAppCredential,
  252. uiDelegate: uiDelegate
  253. )
  254. }
  255. let codeIdentity = try await verifyClient(withUIDelegate: uiDelegate)
  256. let startMFARequestInfo = AuthProtoStartMFAPhoneRequestInfo(phoneNumber: phoneNumber,
  257. codeIdentity: codeIdentity)
  258. do {
  259. if let idToken = session.idToken {
  260. let request = StartMFAEnrollmentRequest(idToken: idToken,
  261. enrollmentInfo: startMFARequestInfo,
  262. requestConfiguration: auth.requestConfiguration)
  263. let response = try await AuthBackend.call(with: request)
  264. return response.phoneSessionInfo?.sessionInfo
  265. } else {
  266. let request = StartMFASignInRequest(MFAPendingCredential: session.mfaPendingCredential,
  267. MFAEnrollmentID: session.multiFactorInfo?.uid,
  268. signInInfo: startMFARequestInfo,
  269. requestConfiguration: auth.requestConfiguration)
  270. let response = try await AuthBackend.call(with: request)
  271. return response.responseInfo?.sessionInfo
  272. }
  273. } catch {
  274. return try await handleVerifyErrorWithRetry(
  275. error: error,
  276. phoneNumber: phoneNumber,
  277. retryOnInvalidAppCredential: retryOnInvalidAppCredential,
  278. multiFactorSession: session,
  279. uiDelegate: uiDelegate
  280. )
  281. }
  282. }
  283. private func handleVerifyErrorWithRetry(error: Error,
  284. phoneNumber: String,
  285. retryOnInvalidAppCredential: Bool,
  286. multiFactorSession session: MultiFactorSession?,
  287. uiDelegate: AuthUIDelegate?) async throws -> String? {
  288. if (error as NSError).code == AuthErrorCode.invalidAppCredential.rawValue {
  289. if retryOnInvalidAppCredential {
  290. auth.appCredentialManager.clearCredential()
  291. return try await verifyClAndSendVerificationCode(toPhoneNumber: phoneNumber,
  292. retryOnInvalidAppCredential: false,
  293. multiFactorSession: session,
  294. uiDelegate: uiDelegate)
  295. }
  296. throw AuthErrorUtils.unexpectedResponse(deserializedResponse: nil, underlyingError: error)
  297. }
  298. throw error
  299. }
  300. /** @fn
  301. @brief Continues the flow to verify the client via silent push notification.
  302. @param completion The callback to be invoked when the client verification flow is finished.
  303. */
  304. private func verifyClient(withUIDelegate uiDelegate: AuthUIDelegate?) async throws
  305. -> CodeIdentity {
  306. // Remove the simulator check below after FCM supports APNs in simulators
  307. #if targetEnvironment(simulator)
  308. let environment = ProcessInfo().environment
  309. if environment["XCTestConfigurationFilePath"] == nil {
  310. return try await CodeIdentity
  311. .recaptcha(reCAPTCHAFlowWithUIDelegate(withUIDelegate: uiDelegate))
  312. }
  313. #endif
  314. if let credential = auth.appCredentialManager.credential {
  315. return CodeIdentity.credential(credential)
  316. }
  317. var token: AuthAPNSToken
  318. do {
  319. token = try await auth.tokenManager.getToken()
  320. } catch {
  321. return try await CodeIdentity
  322. .recaptcha(reCAPTCHAFlowWithUIDelegate(withUIDelegate: uiDelegate))
  323. }
  324. let request = VerifyClientRequest(withAppToken: token.string,
  325. isSandbox: token.type == AuthAPNSTokenType.sandbox,
  326. requestConfiguration: auth.requestConfiguration)
  327. do {
  328. let verifyResponse = try await AuthBackend.call(with: request)
  329. guard let receipt = verifyResponse.receipt,
  330. let timeout = verifyResponse.suggestedTimeOutDate?.timeIntervalSinceNow else {
  331. fatalError("Internal Auth Error: invalid VerifyClientResponse")
  332. }
  333. let credential = await
  334. auth.appCredentialManager.didStartVerification(withReceipt: receipt, timeout: timeout)
  335. if credential.secret == nil {
  336. AuthLog.logWarning(code: "I-AUT000014", message: "Failed to receive remote " +
  337. "notification to verify app identity within \(timeout) " +
  338. "second(s), falling back to reCAPTCHA verification.")
  339. return try await CodeIdentity
  340. .recaptcha(reCAPTCHAFlowWithUIDelegate(withUIDelegate: uiDelegate))
  341. }
  342. return CodeIdentity.credential(credential)
  343. } catch {
  344. let nserror = error as NSError
  345. // reCAPTCHA Flow if it's an invalid app credential or a missing app token.
  346. if (nserror.code == AuthErrorCode.internalError.rawValue &&
  347. (nserror.userInfo[NSUnderlyingErrorKey] as? NSError)?.code ==
  348. AuthErrorCode.invalidAppCredential.rawValue) ||
  349. nserror.code == AuthErrorCode.missingAppToken.rawValue {
  350. return try await CodeIdentity
  351. .recaptcha(reCAPTCHAFlowWithUIDelegate(withUIDelegate: uiDelegate))
  352. } else {
  353. throw error
  354. }
  355. }
  356. }
  357. /** @fn
  358. @brief Continues the flow to verify the client via silent push notification.
  359. @param completion The callback to be invoked when the client verification flow is finished.
  360. */
  361. private func reCAPTCHAFlowWithUIDelegate(withUIDelegate uiDelegate: AuthUIDelegate?) async throws
  362. -> String {
  363. let eventID = AuthWebUtils.randomString(withLength: 10)
  364. guard let url = try await reCAPTCHAURL(withEventID: eventID) else {
  365. fatalError(
  366. "Internal error: reCAPTCHAURL returned neither a value nor an error. Report issue"
  367. )
  368. }
  369. let callbackMatcher: (URL?) -> Bool = { callbackURL in
  370. AuthWebUtils.isExpectedCallbackURL(
  371. callbackURL,
  372. eventID: eventID,
  373. authType: self.kAuthTypeVerifyApp,
  374. callbackScheme: self.callbackScheme
  375. )
  376. }
  377. return try await withCheckedThrowingContinuation { continuation in
  378. self.auth.authURLPresenter.present(url,
  379. uiDelegate: uiDelegate,
  380. callbackMatcher: callbackMatcher) { callbackURL, error in
  381. if let error {
  382. continuation.resume(throwing: error)
  383. } else {
  384. do {
  385. try continuation.resume(returning: self.reCAPTCHAToken(forURL: callbackURL))
  386. } catch {
  387. continuation.resume(throwing: error)
  388. }
  389. }
  390. }
  391. }
  392. }
  393. /**
  394. @brief Parses the reCAPTCHA URL and returns the reCAPTCHA token.
  395. @param URL The url to be parsed for a reCAPTCHA token.
  396. @param error The error that occurred if any.
  397. @return The reCAPTCHA token if successful.
  398. */
  399. private func reCAPTCHAToken(forURL url: URL?) throws -> String {
  400. guard let url = url else {
  401. let reason = "Internal Auth Error: nil URL trying to access RECAPTCHA token"
  402. throw AuthErrorUtils.appVerificationUserInteractionFailure(reason: reason)
  403. }
  404. let actualURLComponents = URLComponents(url: url, resolvingAgainstBaseURL: false)
  405. if let queryItems = actualURLComponents?.queryItems,
  406. let deepLinkURL = AuthWebUtils.queryItemValue(name: "deep_link_id", from: queryItems) {
  407. let deepLinkComponents = URLComponents(string: deepLinkURL)
  408. if let queryItems = deepLinkComponents?.queryItems {
  409. if let token = AuthWebUtils.queryItemValue(name: "recaptchaToken", from: queryItems) {
  410. return token
  411. }
  412. if let firebaseError = AuthWebUtils.queryItemValue(
  413. name: "firebaseError",
  414. from: queryItems
  415. ) {
  416. if let errorData = firebaseError.data(using: .utf8) {
  417. var errorDict: [AnyHashable: Any]?
  418. do {
  419. errorDict = try JSONSerialization.jsonObject(with: errorData) as? [AnyHashable: Any]
  420. } catch {
  421. throw AuthErrorUtils.JSONSerializationError(underlyingError: error)
  422. }
  423. if let errorDict,
  424. let code = errorDict["code"] as? String,
  425. let message = errorDict["message"] as? String {
  426. throw AuthErrorUtils.urlResponseError(code: code, message: message)
  427. }
  428. }
  429. }
  430. }
  431. let reason = "An unknown error occurred with the following response: \(deepLinkURL)"
  432. throw AuthErrorUtils.appVerificationUserInteractionFailure(reason: reason)
  433. }
  434. let reason = "Failed to get url Components for url: \(url)"
  435. throw AuthErrorUtils.appVerificationUserInteractionFailure(reason: reason)
  436. }
  437. /** @fn
  438. @brief Constructs a URL used for opening a reCAPTCHA app verification flow using a given event
  439. ID.
  440. @param eventID The event ID used for this purpose.
  441. @param completion The callback invoked after the URL has been constructed or an error
  442. has been encountered.
  443. */
  444. private func reCAPTCHAURL(withEventID eventID: String) async throws -> URL? {
  445. let authDomain = try await AuthWebUtils
  446. .fetchAuthDomain(withRequestConfiguration: auth.requestConfiguration)
  447. let bundleID = Bundle.main.bundleIdentifier
  448. let clientID = auth.app?.options.clientID
  449. let appID = auth.app?.options.googleAppID
  450. let apiKey = auth.requestConfiguration.apiKey
  451. let appCheck = auth.requestConfiguration.appCheck
  452. var queryItems = [URLQueryItem(name: "apiKey", value: apiKey),
  453. URLQueryItem(name: "authType", value: kAuthTypeVerifyApp),
  454. URLQueryItem(name: "ibi", value: bundleID ?? ""),
  455. URLQueryItem(name: "v", value: AuthBackend.authUserAgent()),
  456. URLQueryItem(name: "eventId", value: eventID)]
  457. if usingClientIDScheme {
  458. queryItems.append(URLQueryItem(name: "clientId", value: clientID))
  459. } else {
  460. queryItems.append(URLQueryItem(name: "appId", value: appID))
  461. }
  462. if let languageCode = auth.requestConfiguration.languageCode {
  463. queryItems.append(URLQueryItem(name: "hl", value: languageCode))
  464. }
  465. var components = URLComponents(string: "https://\(authDomain)/__/auth/handler?")
  466. components?.queryItems = queryItems
  467. if let appCheck {
  468. let tokenResult = await appCheck.getToken(forcingRefresh: false)
  469. if let error = tokenResult.error {
  470. AuthLog.logWarning(code: "I-AUT000018",
  471. message: "Error getting App Check token; using placeholder " +
  472. "token instead. Error: \(error)")
  473. }
  474. let appCheckTokenFragment = "fac=\(tokenResult.token)"
  475. components?.fragment = appCheckTokenFragment
  476. }
  477. return components?.url
  478. }
  479. private let auth: Auth
  480. private let callbackScheme: String
  481. private let usingClientIDScheme: Bool
  482. private init(auth: Auth) {
  483. self.auth = auth
  484. if let clientID = auth.app?.options.clientID {
  485. let reverseClientIDScheme = clientID.components(separatedBy: ".").reversed()
  486. .joined(separator: ".")
  487. if AuthWebUtils.isCallbackSchemeRegistered(forCustomURLScheme: reverseClientIDScheme,
  488. urlTypes: auth.mainBundleUrlTypes) {
  489. callbackScheme = reverseClientIDScheme
  490. usingClientIDScheme = true
  491. return
  492. }
  493. }
  494. usingClientIDScheme = false
  495. if let appID = auth.app?.options.googleAppID {
  496. let dashedAppID = appID.replacingOccurrences(of: ":", with: "-")
  497. callbackScheme = "app-\(dashedAppID)"
  498. return
  499. }
  500. callbackScheme = ""
  501. }
  502. private let kAuthTypeVerifyApp = "verifyApp"
  503. #endif
  504. }