firebase-ios-sdk icon indicating copy to clipboard operation
firebase-ios-sdk copied to clipboard

[v11] Recaptcha Enterprise integration

Open paulb777 opened this issue 1 year ago • 2 comments

Description

Verify Recaptcha Enterprise in v11. Since it relies on reflection, the code is a bit tricky. Follow-up to #13151

  • Verify retrieveRecaptchaToken reflection and functionality
  • Full end-to-end testing of Recaptcha Enterprise integration

Reproducing the issue

Click Initialize Recaptcha Config in the Sample App

Firebase SDK Version

11.0.0

Xcode Version

15.3

Installation Method

Swift Package Manager

Firebase Product(s)

Authentication

Targeted Platforms

iOS

Relevant Log Output

No response

If using Swift Package Manager, the project's Package.resolved

Expand Package.resolved snippet

Replace this line with the contents of your Package.resolved.

If using CocoaPods, the project's Podfile.lock

Expand Podfile.lock snippet

Replace this line with the contents of your Podfile.lock!

paulb777 avatar Jun 19 '24 00:06 paulb777

More investigation today on the following block of code:

Two issues:

  1. Missing defaultAction in map leads to not linked failure:
(lldb) po action 
FirebaseAuth.AuthRecaptchaAction.defaultAction
(lldb) po actionToStringMap 
▿ 3 elements
  ▿ 0 : 2 elements
    - key : FirebaseAuth.AuthRecaptchaAction.signUpPassword
    - value : "signUpPassword"
  ▿ 1 : 2 elements
    - key : FirebaseAuth.AuthRecaptchaAction.signInWithPassword
    - value : "signInWithPassword"
  ▿ 2 : 2 elements
    - key : FirebaseAuth.AuthRecaptchaAction.getOobCode
    - value : "getOobCode"
  1. Fails to do reflection:
po NSClassFromString("RecaptchaAction")  as? any RCAActionProtocol.Type
nil

Screenshot 2024-06-26 at 4 45 51 PM

paulb777 avatar Jun 26 '24 23:06 paulb777

Why does this cast fail?

Screenshot 2024-06-27 at 8 51 16 PM

paulb777 avatar Jun 28 '24 03:06 paulb777