diff --git a/CoreOnly/NOTICES b/CoreOnly/NOTICES
index 66eeb41d12c..80b50ec6410 100644
--- a/CoreOnly/NOTICES
+++ b/CoreOnly/NOTICES
@@ -2178,210 +2178,6 @@ More information at Landon
Fuller's blog
-RecaptchaInterop
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
SwiftProtobuf
Apache License
Version 2.0, January 2004
diff --git a/FirebaseAuth.podspec b/FirebaseAuth.podspec
index 16da93d3a2c..d06c2f16a50 100644
--- a/FirebaseAuth.podspec
+++ b/FirebaseAuth.podspec
@@ -57,7 +57,7 @@ supports email and password accounts, as well as several 3rd party authenticatio
s.dependency 'GoogleUtilities/AppDelegateSwizzler', '~> 7.8'
s.dependency 'GoogleUtilities/Environment', '~> 7.8'
s.dependency 'GTMSessionFetcher/Core', '>= 2.1', '< 4.0'
- s.ios.dependency 'RecaptchaInterop', '~> 18.2.0'
+
s.test_spec 'unit' do |unit_tests|
unit_tests.scheme = { :code_coverage => true }
# Unit tests can't run on watchOS.
diff --git a/FirebaseAuth/CHANGELOG.md b/FirebaseAuth/CHANGELOG.md
index e96f00232f2..7cb0fd941cb 100644
--- a/FirebaseAuth/CHANGELOG.md
+++ b/FirebaseAuth/CHANGELOG.md
@@ -1,5 +1,4 @@
# 10.13.0
-- [added] Added reCAPTCHA verification support in email authentication flows. (#11231)
- [fixed] Fixed a compilation error regression introduced in 10.12.0 building iOS App Extensions. (#11537)
# 10.12.0
diff --git a/FirebaseAuth/Sources/Auth/FIRAuth.m b/FirebaseAuth/Sources/Auth/FIRAuth.m
index cda175637bb..410ed39628e 100644
--- a/FirebaseAuth/Sources/Auth/FIRAuth.m
+++ b/FirebaseAuth/Sources/Auth/FIRAuth.m
@@ -79,7 +79,6 @@
#import "FirebaseAuth/Sources/SystemService/FIRAuthAPNSTokenManager.h"
#import "FirebaseAuth/Sources/SystemService/FIRAuthAppCredentialManager.h"
#import "FirebaseAuth/Sources/SystemService/FIRAuthNotificationManager.h"
-#import "FirebaseAuth/Sources/Utilities/FIRAuthRecaptchaVerifier.h"
#import "FirebaseAuth/Sources/Utilities/FIRAuthURLPresenter.h"
#endif
@@ -165,11 +164,6 @@
*/
static NSString *const kRevertSecondFactorAdditionRequestType = @"REVERT_SECOND_FACTOR_ADDITION";
-/** @var kMissingRecaptchaTokenErrorPrefix
- @brief The prefix of the error message of missing recaptcha token during authenticating.
- */
-static NSString *const kMissingRecaptchaTokenErrorPrefix = @"MISSING_RECAPTCHA_TOKEN";
-
/** @var kMissingPasswordReason
@brief The reason why the @c FIRAuthErrorCodeWeakPassword error is thrown.
@remarks This error message will be localized in the future.
@@ -741,88 +735,11 @@ - (void)signInWithEmail:(NSString *)email
[[FIRVerifyPasswordRequest alloc] initWithEmail:email
password:password
requestConfiguration:_requestConfiguration];
+
if (![request.password length]) {
callback(nil, [FIRAuthErrorUtils wrongPasswordErrorWithMessage:nil]);
return;
}
-#if TARGET_OS_IOS && !TARGET_OS_MACCATALYST && (!defined(TARGET_OS_XR) || !TARGET_OS_XR)
- if ([[FIRAuthRecaptchaVerifier sharedRecaptchaVerifier:self]
- enablementStatusForProvider:FIRAuthRecaptchaProviderPassword]) {
- [[FIRAuthRecaptchaVerifier sharedRecaptchaVerifier:self]
- injectRecaptchaFields:request
- provider:FIRAuthRecaptchaProviderPassword
- action:FIRAuthRecaptchaActionSignInWithPassword
- completion:^(
- FIRIdentityToolkitRequest *requestWithRecaptchaToken) {
- [FIRAuthBackend
- verifyPassword:(FIRVerifyPasswordRequest *)requestWithRecaptchaToken
- callback:^(FIRVerifyPasswordResponse *_Nullable response,
- NSError *_Nullable error) {
- if (error) {
- callback(nil, error);
- return;
- }
- [self completeSignInWithAccessToken:response.IDToken
- accessTokenExpirationDate:response
- .approximateExpirationDate
- refreshToken:response.refreshToken
- anonymous:NO
- callback:callback];
- }];
- }];
- } else {
- [FIRAuthBackend
- verifyPassword:request
- callback:^(FIRVerifyPasswordResponse *_Nullable response, NSError *_Nullable error) {
- if (error) {
- NSError *underlyingError = [error.userInfo objectForKey:NSUnderlyingErrorKey];
- if (error.code == FIRAuthErrorCodeInternalError &&
- [[underlyingError.userInfo
- objectForKey:FIRAuthErrorUserInfoDeserializedResponseKey][@"message"]
- hasPrefix:kMissingRecaptchaTokenErrorPrefix]) {
- [[FIRAuthRecaptchaVerifier sharedRecaptchaVerifier:self]
- injectRecaptchaFields:request
- provider:FIRAuthRecaptchaProviderPassword
- action:FIRAuthRecaptchaActionSignInWithPassword
- completion:^(
- FIRIdentityToolkitRequest *request) {
- [FIRAuthBackend
- verifyPassword:(FIRVerifyPasswordRequest *)request
- callback:^(
- FIRVerifyPasswordResponse *_Nullable response,
- NSError *_Nullable error) {
- if (error) {
- callback(nil, error);
- return;
- }
- [self
- completeSignInWithAccessToken:response.IDToken
- accessTokenExpirationDate:
- response.approximateExpirationDate
- refreshToken:response
- .refreshToken
- anonymous:NO
- callback:callback];
- }];
- }];
- } else {
- callback(nil, error);
- return;
- }
- } else {
- if (error) {
- callback(nil, error);
- return;
- }
- [self completeSignInWithAccessToken:response.IDToken
- accessTokenExpirationDate:response.approximateExpirationDate
- refreshToken:response.refreshToken
- anonymous:NO
- callback:callback];
- }
- }];
- }
-#else
[FIRAuthBackend
verifyPassword:request
callback:^(FIRVerifyPasswordResponse *_Nullable response, NSError *_Nullable error) {
@@ -836,7 +753,6 @@ - (void)signInWithEmail:(NSString *)email
anonymous:NO
callback:callback];
}];
-#endif
}
/** @fn internalSignInAndRetrieveDataWithEmail:password:callback:
@@ -1388,75 +1304,6 @@ - (void)sendPasswordResetWithNullableActionCodeSettings:
passwordResetRequestWithEmail:email
actionCodeSettings:actionCodeSettings
requestConfiguration:self->_requestConfiguration];
-#if TARGET_OS_IOS && !TARGET_OS_MACCATALYST && (!defined(TARGET_OS_XR) || !TARGET_OS_XR)
- if ([[FIRAuthRecaptchaVerifier sharedRecaptchaVerifier:self]
- enablementStatusForProvider:FIRAuthRecaptchaProviderPassword]) {
- [[FIRAuthRecaptchaVerifier sharedRecaptchaVerifier:self]
- injectRecaptchaFields:request
- provider:FIRAuthRecaptchaProviderPassword
- action:FIRAuthRecaptchaActionGetOobCode
- completion:^(
- FIRIdentityToolkitRequest *requestWithRecaptchaToken) {
- [FIRAuthBackend
- getOOBConfirmationCode:(FIRGetOOBConfirmationCodeRequest *)
- requestWithRecaptchaToken
- callback:^(
- FIRGetOOBConfirmationCodeResponse *_Nullable response,
- NSError *_Nullable error) {
- if (completion) {
- dispatch_async(dispatch_get_main_queue(), ^{
- completion(error);
- });
- }
- }];
- }];
- } else {
- [FIRAuthBackend
- getOOBConfirmationCode:request
- callback:^(FIRGetOOBConfirmationCodeResponse *_Nullable response,
- NSError *_Nullable error) {
- if (!error) {
- dispatch_async(dispatch_get_main_queue(), ^{
- completion(nil);
- });
- return;
- }
- NSError *underlyingError =
- [error.userInfo objectForKey:NSUnderlyingErrorKey];
- if (error.code == FIRAuthErrorCodeInternalError &&
- [[underlyingError.userInfo
- objectForKey:FIRAuthErrorUserInfoDeserializedResponseKey]
- [@"message"] hasPrefix:kMissingRecaptchaTokenErrorPrefix]) {
- [[FIRAuthRecaptchaVerifier sharedRecaptchaVerifier:self]
- injectRecaptchaFields:request
- provider:FIRAuthRecaptchaProviderPassword
- action:FIRAuthRecaptchaActionGetOobCode
- completion:^(FIRIdentityToolkitRequest
- *requestWithRecaptchaToken) {
- [FIRAuthBackend
- getOOBConfirmationCode:
- (FIRGetOOBConfirmationCodeRequest *)
- requestWithRecaptchaToken
- callback:^(
- FIRGetOOBConfirmationCodeResponse
- *_Nullable response,
- NSError *_Nullable error) {
- if (completion) {
- dispatch_async(
- dispatch_get_main_queue(), ^{
- completion(error);
- });
- }
- }];
- }];
- } else {
- dispatch_async(dispatch_get_main_queue(), ^{
- completion(error);
- });
- }
- }];
- }
-#else
[FIRAuthBackend getOOBConfirmationCode:request
callback:^(FIRGetOOBConfirmationCodeResponse *_Nullable response,
NSError *_Nullable error) {
@@ -1466,7 +1313,6 @@ - (void)sendPasswordResetWithNullableActionCodeSettings:
});
}
}];
-#endif
});
}
@@ -1487,75 +1333,6 @@ - (void)sendSignInLinkToEmail:(nonnull NSString *)email
[FIRGetOOBConfirmationCodeRequest signInWithEmailLinkRequest:email
actionCodeSettings:actionCodeSettings
requestConfiguration:self->_requestConfiguration];
-#if TARGET_OS_IOS && !TARGET_OS_MACCATALYST && (!defined(TARGET_OS_XR) || !TARGET_OS_XR)
- if ([[FIRAuthRecaptchaVerifier sharedRecaptchaVerifier:self]
- enablementStatusForProvider:FIRAuthRecaptchaProviderPassword]) {
- [[FIRAuthRecaptchaVerifier sharedRecaptchaVerifier:self]
- injectRecaptchaFields:request
- provider:FIRAuthRecaptchaProviderPassword
- action:FIRAuthRecaptchaActionGetOobCode
- completion:^(
- FIRIdentityToolkitRequest *requestWithRecaptchaToken) {
- [FIRAuthBackend
- getOOBConfirmationCode:(FIRGetOOBConfirmationCodeRequest *)
- requestWithRecaptchaToken
- callback:^(
- FIRGetOOBConfirmationCodeResponse *_Nullable response,
- NSError *_Nullable error) {
- if (completion) {
- dispatch_async(dispatch_get_main_queue(), ^{
- completion(error);
- });
- }
- }];
- }];
- } else {
- [FIRAuthBackend
- getOOBConfirmationCode:request
- callback:^(FIRGetOOBConfirmationCodeResponse *_Nullable response,
- NSError *_Nullable error) {
- if (!error) {
- dispatch_async(dispatch_get_main_queue(), ^{
- completion(nil);
- });
- return;
- }
- NSError *underlyingError =
- [error.userInfo objectForKey:NSUnderlyingErrorKey];
- if (error.code == FIRAuthErrorCodeInternalError &&
- [[underlyingError.userInfo
- objectForKey:FIRAuthErrorUserInfoDeserializedResponseKey]
- [@"message"] hasPrefix:kMissingRecaptchaTokenErrorPrefix]) {
- [[FIRAuthRecaptchaVerifier sharedRecaptchaVerifier:self]
- injectRecaptchaFields:request
- provider:FIRAuthRecaptchaProviderPassword
- action:FIRAuthRecaptchaActionGetOobCode
- completion:^(FIRIdentityToolkitRequest
- *requestWithRecaptchaToken) {
- [FIRAuthBackend
- getOOBConfirmationCode:
- (FIRGetOOBConfirmationCodeRequest *)
- requestWithRecaptchaToken
- callback:^(
- FIRGetOOBConfirmationCodeResponse
- *_Nullable response,
- NSError *_Nullable error) {
- if (completion) {
- dispatch_async(
- dispatch_get_main_queue(), ^{
- completion(error);
- });
- }
- }];
- }];
- } else {
- dispatch_async(dispatch_get_main_queue(), ^{
- completion(error);
- });
- }
- }];
- }
-#else
[FIRAuthBackend getOOBConfirmationCode:request
callback:^(FIRGetOOBConfirmationCodeResponse *_Nullable response,
NSError *_Nullable error) {
@@ -1565,7 +1342,6 @@ - (void)sendSignInLinkToEmail:(nonnull NSString *)email
});
}
}];
-#endif
});
}
@@ -1785,19 +1561,6 @@ - (void)revokeTokenWithAuthorizationCode:(NSString *)authorizationCode
}];
}
-#if TARGET_OS_IOS && !TARGET_OS_MACCATALYST && (!defined(TARGET_OS_XR) || !TARGET_OS_XR)
-- (void)initializeRecaptchaConfigWithCompletion:
- (nullable void (^)(NSError *_Nullable error))completion {
- [[FIRAuthRecaptchaVerifier sharedRecaptchaVerifier:self]
- verifyForceRefresh:YES
- action:FIRAuthRecaptchaActionDefault
- completion:^(NSString *_Nullable token, NSError *_Nullable error){
- // Trigger recaptcha verification flow to initialize the recaptcha client and
- // config. Recaptcha token will be thrown.
- }];
-}
-#endif
-
#if TARGET_OS_IOS
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-property-ivar"
@@ -2004,51 +1767,7 @@ - (void)internalCreateUserWithEmail:(NSString *)email
completion(nil, [FIRAuthErrorUtils missingEmailErrorWithMessage:nil]);
return;
}
-
-#if TARGET_OS_IOS && !TARGET_OS_MACCATALYST && (!defined(TARGET_OS_XR) || !TARGET_OS_XR)
- if ([[FIRAuthRecaptchaVerifier sharedRecaptchaVerifier:self]
- enablementStatusForProvider:FIRAuthRecaptchaProviderPassword]) {
- [[FIRAuthRecaptchaVerifier sharedRecaptchaVerifier:self]
- injectRecaptchaFields:request
- provider:FIRAuthRecaptchaProviderPassword
- action:FIRAuthRecaptchaActionSignUpPassword
- completion:^(
- FIRIdentityToolkitRequest *requestWithRecaptchaToken) {
- [FIRAuthBackend
- signUpNewUser:(FIRSignUpNewUserRequest *)requestWithRecaptchaToken
- callback:completion];
- }];
- } else {
- [FIRAuthBackend
- signUpNewUser:request
- callback:^(FIRSignUpNewUserResponse *_Nullable response, NSError *_Nullable error) {
- if (!error) {
- completion(response, nil);
- return;
- }
- NSError *underlyingError = [error.userInfo objectForKey:NSUnderlyingErrorKey];
- if (error.code == FIRAuthErrorCodeInternalError &&
- [[underlyingError.userInfo
- objectForKey:FIRAuthErrorUserInfoDeserializedResponseKey][@"message"]
- hasPrefix:kMissingRecaptchaTokenErrorPrefix]) {
- [[FIRAuthRecaptchaVerifier sharedRecaptchaVerifier:self]
- injectRecaptchaFields:request
- provider:FIRAuthRecaptchaProviderPassword
- action:FIRAuthRecaptchaActionSignUpPassword
- completion:^(FIRIdentityToolkitRequest
- *requestWithRecaptchaToken) {
- [FIRAuthBackend signUpNewUser:(FIRSignUpNewUserRequest *)
- requestWithRecaptchaToken
- callback:completion];
- }];
- } else {
- completion(nil, error);
- }
- }];
- }
-#else
[FIRAuthBackend signUpNewUser:request callback:completion];
-#endif
}
/** @fn internalSignInAnonymouslyWithCompletion:
@@ -2197,10 +1916,10 @@ - (void)scheduleAutoTokenRefreshWithDelay:(NSTimeInterval)delay retry:(BOOL)retr
return;
}
if (error) {
- // Kicks off exponential back off logic to
- // retry failed attempt. Starts with one
- // minute delay (60 seconds) if this is the
- // first failed attempt.
+ // Kicks off exponential back off logic to retry
+ // failed attempt. Starts with one minute delay
+ // (60 seconds) if this is the first failed
+ // attempt.
NSTimeInterval rescheduleDelay;
if (retry) {
rescheduleDelay =
@@ -2278,9 +1997,9 @@ - (FIRAuthResultCallback)signInFlowAuthResultCallbackByDecoratingCallback:
}
/** @fn signInFlowAuthDataResultCallbackByDecoratingCallback:
- @brief Creates a FIRAuthDataResultCallback block which wraps another
- FIRAuthDataResultCallback; trying to update the current user before forwarding it's invocations
- along to a subject block.
+ @brief Creates a FIRAuthDataResultCallback block which wraps another FIRAuthDataResultCallback;
+ trying to update the current user before forwarding it's invocations along to a subject
+ block.
@param callback Called when the user has been updated or when an error has occurred. Invoked
asynchronously on the main thread in the future.
@return Returns a block that updates the current user.
@@ -2413,8 +2132,8 @@ - (BOOL)saveUser:(nullable FIRUser *)user error:(NSError *_Nullable *_Nullable)o
@brief Retrieves the saved user associated, if one exists, from the keychain.
@param outUser An out parameter which is populated with the saved user, if one exists.
@param error Return value for any error which occurs.
- @return YES if the operation was a success (irrespective of whether or not a saved user
- existed for the given @c firebaseAppId,) NO if an error occurred.
+ @return YES if the operation was a success (irrespective of whether or not a saved user existed
+ for the given @c firebaseAppId,) NO if an error occurred.
*/
- (BOOL)getUser:(FIRUser *_Nullable *)outUser error:(NSError *_Nullable *_Nullable)error {
if (!self.userAccessGroup) {
diff --git a/FirebaseAuth/Sources/Backend/FIRAuthBackend+MultiFactor.m b/FirebaseAuth/Sources/Backend/FIRAuthBackend+MultiFactor.m
index 71dc3309d8c..7c305a47420 100644
--- a/FirebaseAuth/Sources/Backend/FIRAuthBackend+MultiFactor.m
+++ b/FirebaseAuth/Sources/Backend/FIRAuthBackend+MultiFactor.m
@@ -24,7 +24,7 @@ @implementation FIRAuthBackend (MultiFactor)
+ (void)startMultiFactorEnrollment:(FIRStartMFAEnrollmentRequest *)request
callback:(FIRStartMFAEnrollmentResponseCallback)callback {
FIRStartMFAEnrollmentResponse *response = [[FIRStartMFAEnrollmentResponse alloc] init];
- [[self implementation] callWithRequest:request
+ [[self implementation] postWithRequest:request
response:response
callback:^(NSError *error) {
if (error) {
@@ -38,7 +38,7 @@ + (void)startMultiFactorEnrollment:(FIRStartMFAEnrollmentRequest *)request
+ (void)finalizeMultiFactorEnrollment:(FIRFinalizeMFAEnrollmentRequest *)request
callback:(FIRFinalizeMFAEnrollmentResponseCallback)callback {
FIRFinalizeMFAEnrollmentResponse *response = [[FIRFinalizeMFAEnrollmentResponse alloc] init];
- [[self implementation] callWithRequest:request
+ [[self implementation] postWithRequest:request
response:response
callback:^(NSError *error) {
if (error) {
@@ -52,7 +52,7 @@ + (void)finalizeMultiFactorEnrollment:(FIRFinalizeMFAEnrollmentRequest *)request
+ (void)startMultiFactorSignIn:(FIRStartMFASignInRequest *)request
callback:(FIRStartMFASignInResponseCallback)callback {
FIRStartMFASignInResponse *response = [[FIRStartMFASignInResponse alloc] init];
- [[self implementation] callWithRequest:request
+ [[self implementation] postWithRequest:request
response:response
callback:^(NSError *error) {
if (error) {
@@ -66,7 +66,7 @@ + (void)startMultiFactorSignIn:(FIRStartMFASignInRequest *)request
+ (void)finalizeMultiFactorSignIn:(FIRFinalizeMFASignInRequest *)request
callback:(FIRFinalizeMFASignInResponseCallback)callback {
FIRFinalizeMFASignInResponse *response = [[FIRFinalizeMFASignInResponse alloc] init];
- [[self implementation] callWithRequest:request
+ [[self implementation] postWithRequest:request
response:response
callback:^(NSError *error) {
if (error) {
@@ -80,7 +80,7 @@ + (void)finalizeMultiFactorSignIn:(FIRFinalizeMFASignInRequest *)request
+ (void)withdrawMultiFactor:(FIRWithdrawMFARequest *)request
callback:(FIRWithdrawMFAResponseCallback)callback {
FIRWithdrawMFAResponse *response = [[FIRWithdrawMFAResponse alloc] init];
- [[self implementation] callWithRequest:request
+ [[self implementation] postWithRequest:request
response:response
callback:^(NSError *error) {
if (error) {
diff --git a/FirebaseAuth/Sources/Backend/FIRAuthBackend.h b/FirebaseAuth/Sources/Backend/FIRAuthBackend.h
index 452532a1b04..e02cc456459 100644
--- a/FirebaseAuth/Sources/Backend/FIRAuthBackend.h
+++ b/FirebaseAuth/Sources/Backend/FIRAuthBackend.h
@@ -56,8 +56,6 @@
@class FIRSignUpNewUserResponse;
@class FIRRevokeTokenRequest;
@class FIRRevokeTokenResponse;
-@class FIRGetRecaptchaConfigRequest;
-@class FIRGetRecaptchaConfigResponse;
@protocol FIRAuthBackendImplementation;
@protocol FIRAuthBackendRPCIssuer;
@@ -243,15 +241,6 @@ typedef void (^FIRRevokeTokenResponseCallback)(FIRRevokeTokenResponse *_Nullable
typedef void (^FIRSignInWithGameCenterResponseCallback)(
FIRSignInWithGameCenterResponse *_Nullable response, NSError *_Nullable error);
-/** @typedef FIRGetRecaptchaConfigResponseCallback
- @brief The type of block used to return the result of a call to the getRecaptchaConfig endpoint.
- @param response The received response, if any.
- @param error The error which occurred, if any.
- @remarks One of response or error will be non-nil.
- */
-typedef void (^FIRGetRecaptchaConfigResponseCallback)(
- FIRGetRecaptchaConfigResponse *_Nullable response, NSError *_Nullable error);
-
/** @class FIRAuthBackend
@brief Simple static class with methods representing the backend RPCs.
@remarks All callback blocks passed as method parameters are invoked asynchronously on the
@@ -409,15 +398,6 @@ typedef void (^FIRGetRecaptchaConfigResponseCallback)(
+ (void)signInWithGameCenter:(FIRSignInWithGameCenterRequest *)request
callback:(FIRSignInWithGameCenterResponseCallback)callback;
-/** @fn getRecaptchaConfig:callback:
- @brief Calls the getRecaptchaConfig endpoint, which is responsible for retrieving the recaptcha
- configs including site key, provider enablement status.
- @param request The request parameters.
- @param callback The callback.
- */
-+ (void)getRecaptchaConfig:(FIRGetRecaptchaConfigRequest *)request
- callback:(FIRGetRecaptchaConfigResponseCallback)callback;
-
#if TARGET_OS_IOS
/** @fn sendVerificationCode:callback:
@brief Calls the sendVerificationCode endpoint, which is responsible for sending the
@@ -464,16 +444,16 @@ typedef void (^FIRGetRecaptchaConfigResponseCallback)(
*/
@protocol FIRAuthBackendRPCIssuer
-/** @fn asyncCallToURLWithRequestConfiguration:URL:body:contentType:completionHandler:
- @brief Asynchronously sends a HTTP request.
+/** @fn asyncPostToURLWithRequestConfiguration:URL:body:contentType:completionHandler:
+ @brief Asynchronously seXnds a POST request.
@param requestConfiguration The request to be made.
@param URL The request URL.
@param body Request body.
@param contentType Content type of the body.
- @param handler provided that handles HTTP response. Invoked asynchronously on the auth global
+ @param handler provided that handles POST response. Invoked asynchronously on the auth global
work queue in the future.
*/
-- (void)asyncCallToURLWithRequestConfiguration:(FIRAuthRequestConfiguration *)requestConfiguration
+- (void)asyncPostToURLWithRequestConfiguration:(FIRAuthRequestConfiguration *)requestConfiguration
URL:(NSURL *)URL
body:(nullable NSData *)body
contentType:(NSString *)contentType
@@ -640,15 +620,6 @@ typedef void (^FIRGetRecaptchaConfigResponseCallback)(
- (void)signInWithGameCenter:(FIRSignInWithGameCenterRequest *)request
callback:(FIRSignInWithGameCenterResponseCallback)callback;
-/** @fn getRecaptchaConfig:callback:
- @brief Calls the getRecaptchaConfig endpoint, which is responsible for retrieving the recaptcha
- configs including site key, provider enablement status.
- @param request The request parameters.
- @param callback The callback.
- */
-- (void)getRecaptchaConfig:(FIRGetRecaptchaConfigRequest *)request
- callback:(FIRGetRecaptchaConfigResponseCallback)callback;
-
/** @fn resetPassword:callback
@brief Calls the resetPassword endpoint, which is responsible for resetting a user's password
given an OOB code and new password.
@@ -658,8 +629,8 @@ typedef void (^FIRGetRecaptchaConfigResponseCallback)(
- (void)resetPassword:(FIRResetPasswordRequest *)request
callback:(FIRResetPasswordCallback)callback;
-/** @fn callWithRequest:response:callback:
- @brief Calls the RPC using HTTP request.
+/** @fn postWithRequest:response:callback:
+ @brief Calls the RPC using HTTP POST.
@remarks Possible error responses:
@see FIRAuthInternalErrorCodeRPCRequestEncodingError
@see FIRAuthInternalErrorCodeJSONSerializationError
@@ -671,7 +642,7 @@ typedef void (^FIRGetRecaptchaConfigResponseCallback)(
@param response The empty response to be filled.
@param callback The callback for both success and failure.
*/
-- (void)callWithRequest:(id)request
+- (void)postWithRequest:(id)request
response:(id)response
callback:(void (^)(NSError *_Nullable error))callback;
diff --git a/FirebaseAuth/Sources/Backend/FIRAuthBackend.m b/FirebaseAuth/Sources/Backend/FIRAuthBackend.m
index 6588611cc1a..183611d3ea5 100644
--- a/FirebaseAuth/Sources/Backend/FIRAuthBackend.m
+++ b/FirebaseAuth/Sources/Backend/FIRAuthBackend.m
@@ -42,8 +42,6 @@
#import "FirebaseAuth/Sources/Backend/RPC/FIRGetOOBConfirmationCodeResponse.h"
#import "FirebaseAuth/Sources/Backend/RPC/FIRGetProjectConfigRequest.h"
#import "FirebaseAuth/Sources/Backend/RPC/FIRGetProjectConfigResponse.h"
-#import "FirebaseAuth/Sources/Backend/RPC/FIRGetRecaptchaConfigRequest.h"
-#import "FirebaseAuth/Sources/Backend/RPC/FIRGetRecaptchaConfigResponse.h"
#import "FirebaseAuth/Sources/Backend/RPC/FIRResetPasswordRequest.h"
#import "FirebaseAuth/Sources/Backend/RPC/FIRResetPasswordResponse.h"
#import "FirebaseAuth/Sources/Backend/RPC/FIRRevokeTokenRequest.h"
@@ -403,6 +401,13 @@
*/
static NSString *const kAppNotVerifiedErrorMessage = @"APP_NOT_VERIFIED";
+/** @var kMissingClientIdentifier
+ @brief This is the error message the server will respond with if Firebase could not verify the
+ app during a phone authentication flow when a real phone number is used and app verification
+ is disabled for testing.
+ */
+static NSString *const kMissingClientIdentifier = @"MISSING_CLIENT_IDENTIFIER";
+
/** @var kCaptchaCheckFailedErrorMessage
@brief This is the error message the server will respond with if the reCAPTCHA token provided is
invalid.
@@ -486,71 +491,6 @@
*/
static NSString *const kInvalidPendingToken = @"INVALID_PENDING_TOKEN";
-/** @var kInvalidRecaptchaScore
- @brief This is the error message the server will respond with if the recaptcha score is invalid.
- */
-static NSString *const kInvalidRecaptchaScore = @"INVALID_RECAPTCHA_SCORE";
-
-/** @var kMissingRecaptchaToken
- @brief This is the error message the server will respond with if the recaptcha token is missing
- in the request.
- */
-static NSString *const kMissingRecaptchaToken = @"MISSING_RECAPTCHA_TOKEN";
-
-/** @var kInvalidRecaptchaToken
- @brief This is the error message the server will respond with if the recaptcha token is invalid.
- */
-static NSString *const kInvalidRecaptchaToken = @"INVALID_RECAPTCHA_TOKEN";
-
-/** @var kInvalidRecaptchaAction
- @brief This is the error message the server will respond with if the recaptcha action is
- invalid.
- */
-static NSString *const kInvalidRecaptchaAction = @"INVALID_RECAPTCHA_ACTION";
-
-/** @var kInvalidRecaptchaEnforcementState
- @brief This is the error message the server will respond with if the recaptcha enforcement state
- is invalid.
- */
-static NSString *const kInvalidRecaptchaEnforcementState = @"INVALID_RECAPTCHA_ENFORCEMENT_STATE";
-
-/** @var kRecaptchaNotEnabled
- @brief This is the error message the server will respond with if recaptcha is not enabled.
- */
-static NSString *const kRecaptchaNotEnabled = @"RECAPTCHA_NOT_ENABLED";
-
-/** @var kMissingClientIdentifier
- @brief This is the error message the server will respond with if Firebase could not verify the
- app during a phone authentication flow when a real phone number is used and app verification
- is disabled for testing.
- */
-static NSString *const kMissingClientIdentifier = @"MISSING_CLIENT_IDENTIFIER";
-
-/** @var kMissingClientType
- @brief This is the error message the server will respond with if Firebase could not verify the
- app during a phone authentication flow when a real phone number is used and app verification
- is disabled for testing.
- */
-static NSString *const kMissingClientType = @"MISSING_CLIENT_TYPE";
-
-/** @var kMissingRecaptchaToken
- @brief This is the error message the server will respond with if the recaptcha token is missing
- in the request.
- */
-static NSString *const kMissingRecaptchaVersion = @"MISSING_RECAPTCHA_VERSION";
-
-/** @var kMissingRecaptchaToken
- @brief This is the error message the server will respond with if the recaptcha token is missing
- in the request.
- */
-static NSString *const kMissingInvalidReqType = @"INVALID_REQ_TYPE";
-
-/** @var kMissingRecaptchaToken
- @brief This is the error message the server will respond with if the recaptcha token is missing
- in the request.
- */
-static NSString *const kInvalidRecaptchaVersion = @"INVALID_RECAPTCHA_VERSION";
-
/** @var gBackendImplementation
@brief The singleton FIRAuthBackendImplementation instance to use.
*/
@@ -683,11 +623,6 @@ + (void)resetPassword:(FIRResetPasswordRequest *)request
[[self implementation] resetPassword:request callback:callback];
}
-+ (void)getRecaptchaConfig:(FIRGetRecaptchaConfigRequest *)request
- callback:(FIRGetRecaptchaConfigResponseCallback)callback {
- [[self implementation] getRecaptchaConfig:request callback:callback];
-}
-
+ (NSString *)authUserAgent {
return [NSString stringWithFormat:@"FirebaseAuth.iOS/%@ %@", FIRFirebaseVersion(),
GTMFetcherStandardUserAgentString(nil)];
@@ -711,8 +646,6 @@ + (void)requestWithURL:(NSURL *)URL
[request setValue:FIRHeaderValueFromHeartbeatsPayload(
[requestConfiguration.heartbeatLogger flushHeartbeatsIntoPayload])
forHTTPHeaderField:kFirebaseHeartbeatHeader];
- NSString *HTTPMethod = requestConfiguration.HTTPMethod;
- [request setValue:HTTPMethod forKey:@"HTTPMethod"];
NSArray *preferredLocalizations = [NSBundle mainBundle].preferredLocalizations;
if (preferredLocalizations.count) {
NSString *acceptLanguage = preferredLocalizations.firstObject;
@@ -766,7 +699,7 @@ - (instancetype)init {
return self;
}
-- (void)asyncCallToURLWithRequestConfiguration:(FIRAuthRequestConfiguration *)requestConfiguration
+- (void)asyncPostToURLWithRequestConfiguration:(FIRAuthRequestConfiguration *)requestConfiguration
URL:(NSURL *)URL
body:(nullable NSData *)body
contentType:(NSString *)contentType
@@ -802,7 +735,7 @@ - (instancetype)init {
- (void)createAuthURI:(FIRCreateAuthURIRequest *)request
callback:(FIRCreateAuthURIResponseCallback)callback {
FIRCreateAuthURIResponse *response = [[FIRCreateAuthURIResponse alloc] init];
- [self callWithRequest:request
+ [self postWithRequest:request
response:response
callback:^(NSError *error) {
if (error) {
@@ -816,7 +749,7 @@ - (void)createAuthURI:(FIRCreateAuthURIRequest *)request
- (void)getAccountInfo:(FIRGetAccountInfoRequest *)request
callback:(FIRGetAccountInfoResponseCallback)callback {
FIRGetAccountInfoResponse *response = [[FIRGetAccountInfoResponse alloc] init];
- [self callWithRequest:request
+ [self postWithRequest:request
response:response
callback:^(NSError *error) {
if (error) {
@@ -830,7 +763,7 @@ - (void)getAccountInfo:(FIRGetAccountInfoRequest *)request
- (void)getProjectConfig:(FIRGetProjectConfigRequest *)request
callback:(FIRGetProjectConfigResponseCallback)callback {
FIRGetProjectConfigResponse *response = [[FIRGetProjectConfigResponse alloc] init];
- [self callWithRequest:request
+ [self postWithRequest:request
response:response
callback:^(NSError *error) {
if (error) {
@@ -844,7 +777,7 @@ - (void)getProjectConfig:(FIRGetProjectConfigRequest *)request
- (void)setAccountInfo:(FIRSetAccountInfoRequest *)request
callback:(FIRSetAccountInfoResponseCallback)callback {
FIRSetAccountInfoResponse *response = [[FIRSetAccountInfoResponse alloc] init];
- [self callWithRequest:request
+ [self postWithRequest:request
response:response
callback:^(NSError *error) {
if (error) {
@@ -859,7 +792,7 @@ - (void)verifyAssertion:(FIRVerifyAssertionRequest *)request
callback:(FIRVerifyAssertionResponseCallback)callback {
FIRVerifyAssertionResponse *response = [[FIRVerifyAssertionResponse alloc] init];
[self
- callWithRequest:request
+ postWithRequest:request
response:response
callback:^(NSError *error) {
if (error) {
@@ -900,7 +833,7 @@ - (void)verifyAssertion:(FIRVerifyAssertionRequest *)request
- (void)verifyCustomToken:(FIRVerifyCustomTokenRequest *)request
callback:(FIRVerifyCustomTokenResponseCallback)callback {
FIRVerifyCustomTokenResponse *response = [[FIRVerifyCustomTokenResponse alloc] init];
- [self callWithRequest:request
+ [self postWithRequest:request
response:response
callback:^(NSError *error) {
if (error) {
@@ -915,7 +848,7 @@ - (void)verifyPassword:(FIRVerifyPasswordRequest *)request
callback:(FIRVerifyPasswordResponseCallback)callback {
FIRVerifyPasswordResponse *response = [[FIRVerifyPasswordResponse alloc] init];
[self
- callWithRequest:request
+ postWithRequest:request
response:response
callback:^(NSError *error) {
if (error) {
@@ -957,7 +890,7 @@ - (void)emailLinkSignin:(FIREmailLinkSignInRequest *)request
callback:(FIREmailLinkSigninResponseCallback)callback {
FIREmailLinkSignInResponse *response = [[FIREmailLinkSignInResponse alloc] init];
[self
- callWithRequest:request
+ postWithRequest:request
response:response
callback:^(NSError *error) {
if (error) {
@@ -998,7 +931,7 @@ - (void)emailLinkSignin:(FIREmailLinkSignInRequest *)request
- (void)secureToken:(FIRSecureTokenRequest *)request
callback:(FIRSecureTokenResponseCallback)callback {
FIRSecureTokenResponse *response = [[FIRSecureTokenResponse alloc] init];
- [self callWithRequest:request
+ [self postWithRequest:request
response:response
callback:^(NSError *error) {
if (error) {
@@ -1012,7 +945,7 @@ - (void)secureToken:(FIRSecureTokenRequest *)request
- (void)getOOBConfirmationCode:(FIRGetOOBConfirmationCodeRequest *)request
callback:(FIRGetOOBConfirmationCodeResponseCallback)callback {
FIRGetOOBConfirmationCodeResponse *response = [[FIRGetOOBConfirmationCodeResponse alloc] init];
- [self callWithRequest:request
+ [self postWithRequest:request
response:response
callback:^(NSError *error) {
if (error) {
@@ -1026,7 +959,7 @@ - (void)getOOBConfirmationCode:(FIRGetOOBConfirmationCodeRequest *)request
- (void)signUpNewUser:(FIRSignUpNewUserRequest *)request
callback:(FIRSignupNewUserCallback)callback {
FIRSignUpNewUserResponse *response = [[FIRSignUpNewUserResponse alloc] init];
- [self callWithRequest:request
+ [self postWithRequest:request
response:response
callback:^(NSError *error) {
if (error) {
@@ -1039,14 +972,14 @@ - (void)signUpNewUser:(FIRSignUpNewUserRequest *)request
- (void)deleteAccount:(FIRDeleteAccountRequest *)request callback:(FIRDeleteCallBack)callback {
FIRDeleteAccountResponse *response = [[FIRDeleteAccountResponse alloc] init];
- [self callWithRequest:request response:response callback:callback];
+ [self postWithRequest:request response:response callback:callback];
}
#if TARGET_OS_IOS
- (void)sendVerificationCode:(FIRSendVerificationCodeRequest *)request
callback:(FIRSendVerificationCodeResponseCallback)callback {
FIRSendVerificationCodeResponse *response = [[FIRSendVerificationCodeResponse alloc] init];
- [self callWithRequest:request
+ [self postWithRequest:request
response:response
callback:^(NSError *error) {
if (error) {
@@ -1061,7 +994,7 @@ - (void)verifyPhoneNumber:(FIRVerifyPhoneNumberRequest *)request
callback:(FIRVerifyPhoneNumberResponseCallback)callback {
FIRVerifyPhoneNumberResponse *response = [[FIRVerifyPhoneNumberResponse alloc] init];
[self
- callWithRequest:request
+ postWithRequest:request
response:response
callback:^(NSError *error) {
if (error) {
@@ -1086,7 +1019,7 @@ - (void)verifyPhoneNumber:(FIRVerifyPhoneNumberRequest *)request
- (void)verifyClient:(id)request callback:(FIRVerifyClientResponseCallback)callback {
FIRVerifyClientResponse *response = [[FIRVerifyClientResponse alloc] init];
- [self callWithRequest:request
+ [self postWithRequest:request
response:response
callback:^(NSError *error) {
if (error) {
@@ -1103,7 +1036,7 @@ - (void)revokeToken:(FIRRevokeTokenRequest *)request
callback:(FIRRevokeTokenResponseCallback)callback {
FIRRevokeTokenResponse *response = [[FIRRevokeTokenResponse alloc] init];
[self
- callWithRequest:request
+ postWithRequest:request
response:response
callback:^(NSError *error) {
if (error) {
@@ -1118,7 +1051,7 @@ - (void)revokeToken:(FIRRevokeTokenRequest *)request
- (void)resetPassword:(FIRResetPasswordRequest *)request
callback:(FIRResetPasswordCallback)callback {
FIRResetPasswordResponse *response = [[FIRResetPasswordResponse alloc] init];
- [self callWithRequest:request
+ [self postWithRequest:request
response:response
callback:^(NSError *error) {
if (error) {
@@ -1132,25 +1065,7 @@ - (void)resetPassword:(FIRResetPasswordRequest *)request
- (void)signInWithGameCenter:(FIRSignInWithGameCenterRequest *)request
callback:(FIRSignInWithGameCenterResponseCallback)callback {
FIRSignInWithGameCenterResponse *response = [[FIRSignInWithGameCenterResponse alloc] init];
- [self callWithRequest:request
- response:response
- callback:^(NSError *error) {
- if (error) {
- if (callback) {
- callback(nil, error);
- }
- } else {
- if (callback) {
- callback(response, nil);
- }
- }
- }];
-}
-
-- (void)getRecaptchaConfig:(FIRGetRecaptchaConfigRequest *)request
- callback:(FIRGetRecaptchaConfigResponseCallback)callback {
- FIRGetRecaptchaConfigResponse *response = [[FIRGetRecaptchaConfigResponse alloc] init];
- [self callWithRequest:request
+ [self postWithRequest:request
response:response
callback:^(NSError *error) {
if (error) {
@@ -1167,8 +1082,8 @@ - (void)getRecaptchaConfig:(FIRGetRecaptchaConfigRequest *)request
#pragma mark - Generic RPC handling methods
-/** @fn callWithRequest:response:callback:
- @brief Calls the RPC using HTTP request.
+/** @fn postWithRequest:response:callback:
+ @brief Calls the RPC using HTTP POST.
@remarks Possible error responses:
@see FIRAuthInternalErrorCodeRPCRequestEncodingError
@see FIRAuthInternalErrorCodeJSONSerializationError
@@ -1180,7 +1095,7 @@ - (void)getRecaptchaConfig:(FIRGetRecaptchaConfigRequest *)request
@param response The empty response to be filled.
@param callback The callback for both success and failure.
*/
-- (void)callWithRequest:(id)request
+- (void)postWithRequest:(id)request
response:(id)response
callback:(void (^)(NSError *_Nullable error))callback {
NSError *error;
@@ -1217,7 +1132,7 @@ - (void)callWithRequest:(id)request
}
[_RPCIssuer
- asyncCallToURLWithRequestConfiguration:[request requestConfiguration]
+ asyncPostToURLWithRequestConfiguration:[request requestConfiguration]
URL:[request requestURL]
body:bodyData
contentType:kJSONContentType
@@ -1556,10 +1471,6 @@ + (nullable NSError *)clientErrorWithServerErrorMessage:(NSString *)serverErrorM
return [FIRAuthErrorUtils missingClientIdentifierErrorWithMessage:serverErrorMessage];
}
- if ([shortErrorMessage isEqualToString:kMissingClientType]) {
- return [FIRAuthErrorUtils missingClientTypeErrorWithMessage:serverErrorMessage];
- }
-
if ([shortErrorMessage isEqualToString:kCaptchaCheckFailedErrorMessage]) {
return [FIRAuthErrorUtils captchaCheckFailedErrorWithMessage:serverErrorMessage];
}
@@ -1631,16 +1542,6 @@ + (nullable NSError *)clientErrorWithServerErrorMessage:(NSString *)serverErrorM
[FIRAuthErrorUtils blockingCloudFunctionServerResponseWithMessage:serverDetailErrorMessage];
}
- if ([shortErrorMessage isEqualToString:kInvalidRecaptchaScore]) {
- return [FIRAuthErrorUtils errorWithCode:FIRAuthInternalErrorCodeCaptchaCheckFailed
- message:serverErrorMessage];
- }
-
- if ([shortErrorMessage isEqualToString:kRecaptchaNotEnabled]) {
- return [FIRAuthErrorUtils errorWithCode:FIRAuthInternalErrorCodeRecaptchaNotEnabled
- message:serverErrorMessage];
- }
-
// In this case we handle an error that might be specified in the underlying errors dictionary,
// the error message in determined based on the @c reason key in the dictionary.
if (errorDictionary[kErrorsKey]) {
diff --git a/FirebaseAuth/Sources/Backend/FIRAuthRPCRequest.h b/FirebaseAuth/Sources/Backend/FIRAuthRPCRequest.h
index aa07bcbffd5..9ca4f449f65 100644
--- a/FirebaseAuth/Sources/Backend/FIRAuthRPCRequest.h
+++ b/FirebaseAuth/Sources/Backend/FIRAuthRPCRequest.h
@@ -52,9 +52,6 @@ NS_ASSUME_NONNULL_BEGIN
*/
- (FIRAuthRequestConfiguration *)requestConfiguration;
-- (void)injectRecaptchaFields:(NSString *_Nullable)recaptchaResponse
- recaptchaVersion:(NSString *)recaptchaVersion;
-
@end
NS_ASSUME_NONNULL_END
diff --git a/FirebaseAuth/Sources/Backend/FIRAuthRequestConfiguration.h b/FirebaseAuth/Sources/Backend/FIRAuthRequestConfiguration.h
index 1801f1a9680..57aef80afaa 100644
--- a/FirebaseAuth/Sources/Backend/FIRAuthRequestConfiguration.h
+++ b/FirebaseAuth/Sources/Backend/FIRAuthRequestConfiguration.h
@@ -58,11 +58,6 @@ NS_ASSUME_NONNULL_BEGIN
*/
@property(nonatomic, copy, nullable) NSString *languageCode;
-/** @property HTTPMethod
- @brief The HTTP method used in the request.
- */
-@property(nonatomic, copy, nonnull) NSString *HTTPMethod;
-
/** @property additionalFrameworkMarker
@brief Additional framework marker that will be added as part of the header of every request.
*/
diff --git a/FirebaseAuth/Sources/Backend/FIRAuthRequestConfiguration.m b/FirebaseAuth/Sources/Backend/FIRAuthRequestConfiguration.m
index faed6414886..e80826299a9 100644
--- a/FirebaseAuth/Sources/Backend/FIRAuthRequestConfiguration.m
+++ b/FirebaseAuth/Sources/Backend/FIRAuthRequestConfiguration.m
@@ -44,7 +44,6 @@ - (nullable instancetype)initWithAPIKey:(NSString *)APIKey
_auth = auth;
_heartbeatLogger = heartbeatLogger;
_appCheck = appCheck;
- _HTTPMethod = @"POST";
}
return self;
}
diff --git a/FirebaseAuth/Sources/Backend/FIRIdentityToolkitRequest.h b/FirebaseAuth/Sources/Backend/FIRIdentityToolkitRequest.h
index 4721820a7fb..b021d536a07 100644
--- a/FirebaseAuth/Sources/Backend/FIRIdentityToolkitRequest.h
+++ b/FirebaseAuth/Sources/Backend/FIRIdentityToolkitRequest.h
@@ -42,21 +42,6 @@ NS_ASSUME_NONNULL_BEGIN
*/
@property(nonatomic, copy, readonly, nullable) NSString *tenantID;
-/** @property useIdentityPlatform
- @brief The toggle of using Identity Platform endpoints.
- */
-@property(nonatomic) BOOL useIdentityPlatform;
-
-/** @property useStaging
- @brief The toggle of using staging endpoints.
- */
-@property(nonatomic) BOOL useStaging;
-
-/** @property clientType
- @brief The type of the client that the request sent from, which should be CLIENT_TYPE_IOS;
- */
-@property(nonatomic, copy) NSString *clientType;
-
/** @fn init
@brief Please use initWithEndpoint:APIKey:
*/
@@ -71,16 +56,16 @@ NS_ASSUME_NONNULL_BEGIN
requestConfiguration:(FIRAuthRequestConfiguration *)requestConfiguration
NS_DESIGNATED_INITIALIZER;
+- (nullable instancetype)initWithEndpoint:(NSString *)endpoint
+ requestConfiguration:(FIRAuthRequestConfiguration *)requestConfiguration
+ useIdentityPlatform:(BOOL)useIdentityPlatform
+ useStaging:(BOOL)useStaging;
+
/** @fn requestURL
@brief Gets the request's full URL.
*/
- (NSURL *)requestURL;
-/** @fn queryParams
- @brief Gets the request's query parameters.
- */
-- (nullable NSString *)queryParams;
-
/** @fn requestConfiguration
@brief Gets the request's configuration.
*/
diff --git a/FirebaseAuth/Sources/Backend/FIRIdentityToolkitRequest.m b/FirebaseAuth/Sources/Backend/FIRIdentityToolkitRequest.m
index e7a606f8ecb..de582966d51 100644
--- a/FirebaseAuth/Sources/Backend/FIRIdentityToolkitRequest.m
+++ b/FirebaseAuth/Sources/Backend/FIRIdentityToolkitRequest.m
@@ -37,10 +37,12 @@
static NSString *kIdentityPlatformStagingAPIHost =
@"staging-identitytoolkit.sandbox.googleapis.com";
-static NSString *const kClientType = @"CLIENT_TYPE_IOS";
-
@implementation FIRIdentityToolkitRequest {
FIRAuthRequestConfiguration *_requestConfiguration;
+
+ BOOL _useIdentityPlatform;
+
+ BOOL _useStaging;
}
- (nullable instancetype)initWithEndpoint:(NSString *)endpoint
@@ -52,7 +54,6 @@ - (nullable instancetype)initWithEndpoint:(NSString *)endpoint
_requestConfiguration = requestConfiguration;
_useIdentityPlatform = NO;
_useStaging = NO;
- _clientType = kClientType;
// Automatically set the tenant ID. If the request is initialized before FIRAuth is configured,
// set tenant ID to nil.
@@ -65,12 +66,20 @@ - (nullable instancetype)initWithEndpoint:(NSString *)endpoint
return self;
}
-- (BOOL)containsPostBody {
- return YES;
+- (nullable instancetype)initWithEndpoint:(NSString *)endpoint
+ requestConfiguration:(FIRAuthRequestConfiguration *)requestConfiguration
+ useIdentityPlatform:(BOOL)useIdentityPlatform
+ useStaging:(BOOL)useStaging {
+ self = [self initWithEndpoint:endpoint requestConfiguration:requestConfiguration];
+ if (self) {
+ _useIdentityPlatform = useIdentityPlatform;
+ _useStaging = useStaging;
+ }
+ return self;
}
-- (nullable NSString *)queryParams {
- return nil;
+- (BOOL)containsPostBody {
+ return YES;
}
- (NSURL *)requestURL {
@@ -106,14 +115,8 @@ - (NSURL *)requestURL {
apiHostAndPathPrefix = kFirebaseAuthAPIHost;
}
}
- NSMutableString *URLString = [NSMutableString
+ NSString *URLString = [NSString
stringWithFormat:apiURLFormat, apiProtocol, apiHostAndPathPrefix, _endpoint, _APIKey];
-
- NSString *queryParams = [self queryParams];
- if (queryParams) {
- [URLString appendString:queryParams];
- }
-
NSURL *URL = [NSURL URLWithString:URLString];
return URL;
}
diff --git a/FirebaseAuth/Sources/Backend/RPC/FIRGetOOBConfirmationCodeRequest.h b/FirebaseAuth/Sources/Backend/RPC/FIRGetOOBConfirmationCodeRequest.h
index 38ada8577cd..dc48a3ed068 100644
--- a/FirebaseAuth/Sources/Backend/RPC/FIRGetOOBConfirmationCodeRequest.h
+++ b/FirebaseAuth/Sources/Backend/RPC/FIRGetOOBConfirmationCodeRequest.h
@@ -112,16 +112,6 @@ typedef NS_ENUM(NSInteger, FIRGetOOBConfirmationCodeRequestType) {
*/
@property(copy, nonatomic, nullable) NSString *dynamicLinkDomain;
-/** @property captchaResponse
- @brief Response to the captcha.
- */
-@property(nonatomic, copy, nullable) NSString *captchaResponse;
-
-/** @property captchaResponse
- @brief The reCAPTCHA version.
- */
-@property(nonatomic, copy, nullable) NSString *recaptchaVersion;
-
/** @fn passwordResetRequestWithEmail:actionCodeSettings:requestConfiguration:
@brief Creates a password reset request.
@param email The user's email address.
diff --git a/FirebaseAuth/Sources/Backend/RPC/FIRGetOOBConfirmationCodeRequest.m b/FirebaseAuth/Sources/Backend/RPC/FIRGetOOBConfirmationCodeRequest.m
index e0c7d547f8f..a749a543735 100644
--- a/FirebaseAuth/Sources/Backend/RPC/FIRGetOOBConfirmationCodeRequest.m
+++ b/FirebaseAuth/Sources/Backend/RPC/FIRGetOOBConfirmationCodeRequest.m
@@ -111,21 +111,6 @@
*/
static NSString *const kTenantIDKey = @"tenantId";
-/** @var kCaptchaResponseKey
- @brief The key for the "captchaResponse" value in the request.
- */
-static NSString *const kCaptchaResponseKey = @"captchaResp";
-
-/** @var kClientType
- @brief The key for the "clientType" value in the request.
- */
-static NSString *const kClientType = @"clientType";
-
-/** @var kRecaptchaVersion
- @brief The key for the "recaptchaVersion" value in the request.
- */
-static NSString *const kRecaptchaVersion = @"recaptchaVersion";
-
@interface FIRGetOOBConfirmationCodeRequest ()
/** @fn initWithRequestType:email:APIKey:
@@ -246,57 +231,59 @@ - (nullable id)unencodedHTTPRequestBodyWithError:(NSError *_Nullable *_Nullable)
NSMutableDictionary *body =
[@{kRequestTypeKey : [[self class] requestTypeStringValueForRequestType:_requestType]}
mutableCopy];
+
// For password reset requests, we only need an email address in addition to the already required
// fields.
if (_requestType == FIRGetOOBConfirmationCodeRequestTypePasswordReset) {
body[kEmailKey] = _email;
}
+
// For verify email requests, we only need an STS Access Token in addition to the already required
// fields.
if (_requestType == FIRGetOOBConfirmationCodeRequestTypeVerifyEmail) {
body[kIDTokenKey] = _accessToken;
}
+
// For email sign-in link requests, we only need an email address in addition to the already
// required fields.
if (_requestType == FIRGetOOBConfirmationCodeRequestTypeEmailLink) {
body[kEmailKey] = _email;
}
+
// For email sign-in link requests, we only need an STS Access Token, a new email address in
// addition to the already required fields.
if (_requestType == FIRGetOOBConfirmationCodeRequestTypeVerifyBeforeUpdateEmail) {
body[kNewEmailKey] = _updatedEmail;
body[kIDTokenKey] = _accessToken;
}
+
if (_continueURL) {
body[kContinueURLKey] = _continueURL;
}
+
if (_iOSBundleID) {
body[kIosBundleIDKey] = _iOSBundleID;
}
+
if (_androidPackageName) {
body[kAndroidPackageNameKey] = _androidPackageName;
}
+
if (_androidMinimumVersion) {
body[kAndroidMinimumVersionKey] = _androidMinimumVersion;
}
+
if (_androidInstallApp) {
body[kAndroidInstallAppKey] = @YES;
}
+
if (_handleCodeInApp) {
body[kCanHandleCodeInAppKey] = @YES;
}
+
if (_dynamicLinkDomain) {
body[kDynamicLinkDomainKey] = _dynamicLinkDomain;
}
- if (_captchaResponse) {
- body[kCaptchaResponseKey] = _captchaResponse;
- }
- if (self.clientType) {
- body[kClientType] = self.clientType;
- }
- if (_recaptchaVersion) {
- body[kRecaptchaVersion] = _recaptchaVersion;
- }
if (self.tenantID) {
body[kTenantIDKey] = self.tenantID;
}
@@ -304,12 +291,6 @@ - (nullable id)unencodedHTTPRequestBodyWithError:(NSError *_Nullable *_Nullable)
return body;
}
-- (void)injectRecaptchaFields:(NSString *_Nullable)recaptchaResponse
- recaptchaVersion:(NSString *)recaptchaVersion {
- _captchaResponse = recaptchaResponse;
- _recaptchaVersion = recaptchaVersion;
-}
-
@end
NS_ASSUME_NONNULL_END
diff --git a/FirebaseAuth/Sources/Backend/RPC/FIRGetRecaptchaConfigRequest.h b/FirebaseAuth/Sources/Backend/RPC/FIRGetRecaptchaConfigRequest.h
deleted file mode 100644
index 64c652fadd5..00000000000
--- a/FirebaseAuth/Sources/Backend/RPC/FIRGetRecaptchaConfigRequest.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright 2022 Google LLC
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#import
-
-#import "FirebaseAuth/Sources/Backend/FIRAuthRPCRequest.h"
-#import "FirebaseAuth/Sources/Backend/FIRIdentityToolkitRequest.h"
-
-NS_ASSUME_NONNULL_BEGIN
-
-/** @class FIRGetRecaptchaConfigRequest
- @brief Represents the parameters for the getRecaptchaConfig endpoint.
- */
-@interface FIRGetRecaptchaConfigRequest : FIRIdentityToolkitRequest
-
-/** @fn initWithEndpoint:requestConfiguration:
- @brief Please use initWithClientType:version:requestConfiguration:
- */
-- (nullable instancetype)initWithEndpoint:(NSString *)endpoint
- requestConfiguration:(FIRAuthRequestConfiguration *)requestConfiguration
- NS_UNAVAILABLE;
-
-/** @fn initWithEmail:password:requestConfiguration:
- @brief Designated initializer.
- @param requestConfiguration The config.
- */
-- (nullable instancetype)initWithRequestConfiguration:
- (FIRAuthRequestConfiguration *)requestConfiguration NS_DESIGNATED_INITIALIZER;
-
-@end
-
-NS_ASSUME_NONNULL_END
diff --git a/FirebaseAuth/Sources/Backend/RPC/FIRGetRecaptchaConfigRequest.m b/FirebaseAuth/Sources/Backend/RPC/FIRGetRecaptchaConfigRequest.m
deleted file mode 100644
index c913a44d1ef..00000000000
--- a/FirebaseAuth/Sources/Backend/RPC/FIRGetRecaptchaConfigRequest.m
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright 2022 Google LLC
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#import "FirebaseAuth/Sources/Backend/RPC/FIRGetRecaptchaConfigRequest.h"
-
-NS_ASSUME_NONNULL_BEGIN
-
-static NSString *const kRecaptchaVersion = @"RECAPTCHA_ENTERPRISE";
-
-/** @var kGetRecaptchaConfigEndpoint
- @brief The "getRecaptchaConfig" endpoint.
- */
-static NSString *const kGetRecaptchaConfigEndpoint = @"recaptchaConfig";
-
-/** @var kClientType
- @brief The key for the "clientType" value in the request.
- */
-static NSString *const kClientTypeKey = @"clientType";
-
-/** @var kVersionKey
- @brief The key for the "version" value in the request.
- */
-static NSString *const kVersionKey = @"version";
-
-/** @var kTenantIDKey
- @brief The key for the tenant id value in the request.
- */
-static NSString *const kTenantIDKey = @"tenantId";
-
-@implementation FIRGetRecaptchaConfigRequest
-
-- (nullable instancetype)initWithRequestConfiguration:
- (nonnull FIRAuthRequestConfiguration *)requestConfiguration {
- requestConfiguration.HTTPMethod = @"GET";
- self = [super initWithEndpoint:kGetRecaptchaConfigEndpoint
- requestConfiguration:requestConfiguration];
- self.useIdentityPlatform = YES;
- return self;
-}
-
-- (BOOL)containsPostBody {
- return NO;
-}
-
-- (nullable NSString *)queryParams {
- NSMutableString *queryParams = [[NSMutableString alloc] init];
- [queryParams appendFormat:@"&%@=%@&%@=%@", kClientTypeKey, self.clientType, kVersionKey,
- kRecaptchaVersion];
- if (self.tenantID) {
- [queryParams appendFormat:@"&%@=%@", kTenantIDKey, self.tenantID];
- }
- return queryParams;
-}
-
-- (nullable id)unencodedHTTPRequestBodyWithError:(NSError *_Nullable *_Nullable)error {
- return nil;
-}
-
-@end
-
-NS_ASSUME_NONNULL_END
diff --git a/FirebaseAuth/Sources/Backend/RPC/FIRGetRecaptchaConfigResponse.h b/FirebaseAuth/Sources/Backend/RPC/FIRGetRecaptchaConfigResponse.h
deleted file mode 100644
index dfa87093d2c..00000000000
--- a/FirebaseAuth/Sources/Backend/RPC/FIRGetRecaptchaConfigResponse.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright 2022 Google LLC
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#import
-
-#import "FirebaseAuth/Sources/Backend/FIRAuthRPCResponse.h"
-
-NS_ASSUME_NONNULL_BEGIN
-
-/** @class FIRVerifyPasswordResponse
- @brief Represents the response from the getRecaptchaConfig endpoint.
- */
-@interface FIRGetRecaptchaConfigResponse : NSObject
-
-/** @property recaptchaKey
- @brief The recaptcha key of the project.
- */
-@property(nonatomic, copy, nullable) NSString *recaptchaKey;
-
-/** @property enforcementState
- @brief The enforcement state array.
- */
-@property(nonatomic, nullable) NSArray *enforcementState;
-
-@end
-
-NS_ASSUME_NONNULL_END
diff --git a/FirebaseAuth/Sources/Backend/RPC/FIRGetRecaptchaConfigResponse.m b/FirebaseAuth/Sources/Backend/RPC/FIRGetRecaptchaConfigResponse.m
deleted file mode 100644
index da39f8590b4..00000000000
--- a/FirebaseAuth/Sources/Backend/RPC/FIRGetRecaptchaConfigResponse.m
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright 2022 Google LLC
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#import "FirebaseAuth/Sources/Backend/RPC/FIRGetRecaptchaConfigResponse.h"
-
-NS_ASSUME_NONNULL_BEGIN
-
-@implementation FIRGetRecaptchaConfigResponse
-
-- (BOOL)setWithDictionary:(NSDictionary *)dictionary error:(NSError *_Nullable *_Nullable)error {
- _recaptchaKey = [dictionary[@"recaptchaKey"] copy];
- _enforcementState = dictionary[@"recaptchaEnforcementState"];
- return YES;
-}
-
-@end
-
-NS_ASSUME_NONNULL_END
diff --git a/FirebaseAuth/Sources/Backend/RPC/FIRRevokeTokenRequest.m b/FirebaseAuth/Sources/Backend/RPC/FIRRevokeTokenRequest.m
index 4d676d8030e..418329ff1b1 100644
--- a/FirebaseAuth/Sources/Backend/RPC/FIRRevokeTokenRequest.m
+++ b/FirebaseAuth/Sources/Backend/RPC/FIRRevokeTokenRequest.m
@@ -66,8 +66,10 @@ @implementation FIRRevokeTokenRequest
- (nullable instancetype)initWithToken:(NSString *)token
idToken:(NSString *)idToken
requestConfiguration:(FIRAuthRequestConfiguration *)requestConfiguration {
- self = [super initWithEndpoint:kRevokeTokenEndpoint requestConfiguration:requestConfiguration];
- self.useIdentityPlatform = YES;
+ self = [super initWithEndpoint:kRevokeTokenEndpoint
+ requestConfiguration:requestConfiguration
+ useIdentityPlatform:YES
+ useStaging:NO];
if (self) {
// Apple and authorization code are the only provider and token type we support for now.
// Generalize this initializer to accept other providers and token types once supported.
diff --git a/FirebaseAuth/Sources/Backend/RPC/FIRSignUpNewUserRequest.h b/FirebaseAuth/Sources/Backend/RPC/FIRSignUpNewUserRequest.h
index e8b3196fe34..070290d0aca 100644
--- a/FirebaseAuth/Sources/Backend/RPC/FIRSignUpNewUserRequest.h
+++ b/FirebaseAuth/Sources/Backend/RPC/FIRSignUpNewUserRequest.h
@@ -38,16 +38,6 @@ NS_ASSUME_NONNULL_BEGIN
*/
@property(nonatomic, copy, nullable) NSString *displayName;
-/** @property captchaResponse
- @brief Response to the captcha.
- */
-@property(nonatomic, copy, nullable) NSString *captchaResponse;
-
-/** @property captchaResponse
- @brief The reCAPTCHA version.
- */
-@property(nonatomic, copy, nullable) NSString *recaptchaVersion;
-
/** @property returnSecureToken
@brief Whether the response should return access token and refresh token directly.
@remarks The default value is @c YES .
diff --git a/FirebaseAuth/Sources/Backend/RPC/FIRSignUpNewUserRequest.m b/FirebaseAuth/Sources/Backend/RPC/FIRSignUpNewUserRequest.m
index e61bcfc0597..198e450b02b 100644
--- a/FirebaseAuth/Sources/Backend/RPC/FIRSignUpNewUserRequest.m
+++ b/FirebaseAuth/Sources/Backend/RPC/FIRSignUpNewUserRequest.m
@@ -38,21 +38,6 @@
*/
static NSString *const kDisplayNameKey = @"displayName";
-/** @var kCaptchaResponseKey
- @brief The key for the "captchaResponse" value in the request.
- */
-static NSString *const kCaptchaResponseKey = @"captchaResponse";
-
-/** @var kClientType
- @brief The key for the "clientType" value in the request.
- */
-static NSString *const kClientType = @"clientType";
-
-/** @var kRecaptchaVersion
- @brief The key for the "recaptchaVersion" value in the request.
- */
-static NSString *const kRecaptchaVersion = @"recaptchaVersion";
-
/** @var kReturnSecureTokenKey
@brief The key for the "returnSecureToken" value in the request.
*/
@@ -99,15 +84,6 @@ - (nullable id)unencodedHTTPRequestBodyWithError:(NSError *_Nullable *_Nullable)
if (_displayName) {
postBody[kDisplayNameKey] = _displayName;
}
- if (_captchaResponse) {
- postBody[kCaptchaResponseKey] = _captchaResponse;
- }
- if (self.clientType) {
- postBody[kClientType] = self.clientType;
- }
- if (_recaptchaVersion) {
- postBody[kRecaptchaVersion] = _recaptchaVersion;
- }
if (_returnSecureToken) {
postBody[kReturnSecureTokenKey] = @YES;
}
@@ -117,12 +93,6 @@ - (nullable id)unencodedHTTPRequestBodyWithError:(NSError *_Nullable *_Nullable)
return [postBody copy];
}
-- (void)injectRecaptchaFields:(NSString *_Nullable)recaptchaResponse
- recaptchaVersion:(NSString *)recaptchaVersion {
- _captchaResponse = recaptchaResponse;
- _recaptchaVersion = recaptchaVersion;
-}
-
@end
NS_ASSUME_NONNULL_END
diff --git a/FirebaseAuth/Sources/Backend/RPC/FIRVerifyPasswordRequest.h b/FirebaseAuth/Sources/Backend/RPC/FIRVerifyPasswordRequest.h
index bb1fde2db0f..5931578ebfd 100644
--- a/FirebaseAuth/Sources/Backend/RPC/FIRVerifyPasswordRequest.h
+++ b/FirebaseAuth/Sources/Backend/RPC/FIRVerifyPasswordRequest.h
@@ -52,11 +52,6 @@ NS_ASSUME_NONNULL_BEGIN
*/
@property(nonatomic, copy, nullable) NSString *captchaResponse;
-/** @property captchaResponse
- @brief The reCAPTCHA version.
- */
-@property(nonatomic, copy, nullable) NSString *recaptchaVersion;
-
/** @property returnSecureToken
@brief Whether the response should return access token and refresh token directly.
@remarks The default value is @c YES .
diff --git a/FirebaseAuth/Sources/Backend/RPC/FIRVerifyPasswordRequest.m b/FirebaseAuth/Sources/Backend/RPC/FIRVerifyPasswordRequest.m
index 7a2d6a44513..97ac2a7d7c0 100644
--- a/FirebaseAuth/Sources/Backend/RPC/FIRVerifyPasswordRequest.m
+++ b/FirebaseAuth/Sources/Backend/RPC/FIRVerifyPasswordRequest.m
@@ -48,16 +48,6 @@
*/
static NSString *const kCaptchaResponseKey = @"captchaResponse";
-/** @var kClientType
- @brief The key for the "clientType" value in the request.
- */
-static NSString *const kClientType = @"clientType";
-
-/** @var kRecaptchaVersion
- @brief The key for the "recaptchaVersion" value in the request.
- */
-static NSString *const kRecaptchaVersion = @"recaptchaVersion";
-
/** @var kReturnSecureTokenKey
@brief The key for the "returnSecureToken" value in the request.
*/
@@ -99,27 +89,15 @@ - (nullable id)unencodedHTTPRequestBodyWithError:(NSError *_Nullable *_Nullable)
if (_captchaResponse) {
postBody[kCaptchaResponseKey] = _captchaResponse;
}
- if (_recaptchaVersion) {
- postBody[kRecaptchaVersion] = _recaptchaVersion;
- }
if (_returnSecureToken) {
postBody[kReturnSecureTokenKey] = @YES;
}
if (self.tenantID) {
postBody[kTenantIDKey] = self.tenantID;
}
- if (self.clientType) {
- postBody[kClientType] = self.clientType;
- }
return [postBody copy];
}
-- (void)injectRecaptchaFields:(NSString *_Nullable)recaptchaResponse
- recaptchaVersion:(NSString *)recaptchaVersion {
- _captchaResponse = recaptchaResponse;
- _recaptchaVersion = recaptchaVersion;
-}
-
@end
NS_ASSUME_NONNULL_END
diff --git a/FirebaseAuth/Sources/Backend/RPC/MultiFactor/Enroll/FIRFinalizeMFAEnrollmentRequest.m b/FirebaseAuth/Sources/Backend/RPC/MultiFactor/Enroll/FIRFinalizeMFAEnrollmentRequest.m
index 1a309670fa7..a997c81c66d 100644
--- a/FirebaseAuth/Sources/Backend/RPC/MultiFactor/Enroll/FIRFinalizeMFAEnrollmentRequest.m
+++ b/FirebaseAuth/Sources/Backend/RPC/MultiFactor/Enroll/FIRFinalizeMFAEnrollmentRequest.m
@@ -33,8 +33,9 @@ - (nullable instancetype)initWithIDToken:(NSString *)IDToken
(FIRAuthProtoFinalizeMFAPhoneRequestInfo *)phoneVerificationInfo
requestConfiguration:(FIRAuthRequestConfiguration *)requestConfiguration {
self = [super initWithEndpoint:kFinalizeMFAEnrollmentEndPoint
- requestConfiguration:requestConfiguration];
- self.useIdentityPlatform = YES;
+ requestConfiguration:requestConfiguration
+ useIdentityPlatform:YES
+ useStaging:NO];
if (self) {
_IDToken = IDToken;
_displayName = displayName;
@@ -49,8 +50,9 @@ - (nullable instancetype)initWithIDToken:(NSString *)IDToken
(FIRAuthProtoFinalizeMFATOTPEnrollmentRequestInfo *)TOTPVerificationInfo
requestConfiguration:(FIRAuthRequestConfiguration *)requestConfiguration {
self = [super initWithEndpoint:kFinalizeMFAEnrollmentEndPoint
- requestConfiguration:requestConfiguration];
- self.useIdentityPlatform = YES;
+ requestConfiguration:requestConfiguration
+ useIdentityPlatform:YES
+ useStaging:NO];
if (self) {
_IDToken = IDToken;
_displayName = displayName;
diff --git a/FirebaseAuth/Sources/Backend/RPC/MultiFactor/Enroll/FIRStartMFAEnrollmentRequest.m b/FirebaseAuth/Sources/Backend/RPC/MultiFactor/Enroll/FIRStartMFAEnrollmentRequest.m
index a6762f90920..6a09df138ba 100644
--- a/FirebaseAuth/Sources/Backend/RPC/MultiFactor/Enroll/FIRStartMFAEnrollmentRequest.m
+++ b/FirebaseAuth/Sources/Backend/RPC/MultiFactor/Enroll/FIRStartMFAEnrollmentRequest.m
@@ -31,8 +31,9 @@ - (nullable instancetype)initWithIDToken:(NSString *)IDToken
enrollmentInfo:(FIRAuthProtoStartMFAPhoneRequestInfo *)phoneEnrollmentInfo
requestConfiguration:(FIRAuthRequestConfiguration *)requestConfiguration {
self = [super initWithEndpoint:kStartMFAEnrollmentEndPoint
- requestConfiguration:requestConfiguration];
- self.useIdentityPlatform = YES;
+ requestConfiguration:requestConfiguration
+ useIdentityPlatform:YES
+ useStaging:NO];
if (self) {
_IDToken = IDToken;
_phoneEnrollmentInfo = phoneEnrollmentInfo;
@@ -45,8 +46,9 @@ - (nullable instancetype)initWithIDToken:(NSString *)IDToken
(FIRAuthProtoStartMFATOTPEnrollmentRequestInfo *)TOTPEnrollmentInfo
requestConfiguration:(FIRAuthRequestConfiguration *)requestConfiguration {
self = [super initWithEndpoint:kStartMFAEnrollmentEndPoint
- requestConfiguration:requestConfiguration];
- self.useIdentityPlatform = YES;
+ requestConfiguration:requestConfiguration
+ useIdentityPlatform:YES
+ useStaging:NO];
if (self) {
_IDToken = IDToken;
_TOTPEnrollmentInfo = TOTPEnrollmentInfo;
diff --git a/FirebaseAuth/Sources/Backend/RPC/MultiFactor/SignIn/FIRFinalizeMFASignInRequest.m b/FirebaseAuth/Sources/Backend/RPC/MultiFactor/SignIn/FIRFinalizeMFASignInRequest.m
index be676cacf75..e4f49abc6f6 100644
--- a/FirebaseAuth/Sources/Backend/RPC/MultiFactor/SignIn/FIRFinalizeMFASignInRequest.m
+++ b/FirebaseAuth/Sources/Backend/RPC/MultiFactor/SignIn/FIRFinalizeMFASignInRequest.m
@@ -30,8 +30,9 @@ - (nullable instancetype)initWithMFAPendingCredential:(NSString *)MFAPendingCred
requestConfiguration:
(FIRAuthRequestConfiguration *)requestConfiguration {
self = [super initWithEndpoint:kFinalizeMFASignInEndPoint
- requestConfiguration:requestConfiguration];
- self.useIdentityPlatform = YES;
+ requestConfiguration:requestConfiguration
+ useIdentityPlatform:YES
+ useStaging:NO];
if (self) {
_MFAPendingCredential = MFAPendingCredential;
_verificationInfo = verificationInfo;
diff --git a/FirebaseAuth/Sources/Backend/RPC/MultiFactor/SignIn/FIRStartMFASignInRequest.m b/FirebaseAuth/Sources/Backend/RPC/MultiFactor/SignIn/FIRStartMFASignInRequest.m
index fc312d38651..dee5b2cd213 100644
--- a/FirebaseAuth/Sources/Backend/RPC/MultiFactor/SignIn/FIRStartMFASignInRequest.m
+++ b/FirebaseAuth/Sources/Backend/RPC/MultiFactor/SignIn/FIRStartMFASignInRequest.m
@@ -30,8 +30,10 @@ @implementation FIRStartMFASignInRequest
MFAEnrollmentID:(NSString *)MFAEnrollmentID
signInInfo:(FIRAuthProtoStartMFAPhoneRequestInfo *)signInInfo
requestConfiguration:(FIRAuthRequestConfiguration *)requestConfiguration {
- self = [super initWithEndpoint:kStartMFASignInEndPoint requestConfiguration:requestConfiguration];
- self.useIdentityPlatform = YES;
+ self = [super initWithEndpoint:kStartMFASignInEndPoint
+ requestConfiguration:requestConfiguration
+ useIdentityPlatform:YES
+ useStaging:NO];
if (self) {
_MFAPendingCredential = MFAPendingCredential;
_MFAEnrollmentID = MFAEnrollmentID;
diff --git a/FirebaseAuth/Sources/Backend/RPC/MultiFactor/Unenroll/FIRWithdrawMFARequest.m b/FirebaseAuth/Sources/Backend/RPC/MultiFactor/Unenroll/FIRWithdrawMFARequest.m
index 18e3b08057b..a7038c39661 100644
--- a/FirebaseAuth/Sources/Backend/RPC/MultiFactor/Unenroll/FIRWithdrawMFARequest.m
+++ b/FirebaseAuth/Sources/Backend/RPC/MultiFactor/Unenroll/FIRWithdrawMFARequest.m
@@ -30,8 +30,10 @@ @implementation FIRWithdrawMFARequest
- (nullable instancetype)initWithIDToken:(NSString *)IDToken
MFAEnrollmentID:(NSString *)MFAEnrollmentID
requestConfiguration:(FIRAuthRequestConfiguration *)requestConfiguration {
- self = [super initWithEndpoint:kWithdrawMFAEndPoint requestConfiguration:requestConfiguration];
- self.useIdentityPlatform = YES;
+ self = [super initWithEndpoint:kWithdrawMFAEndPoint
+ requestConfiguration:requestConfiguration
+ useIdentityPlatform:YES
+ useStaging:NO];
if (self) {
_IDToken = IDToken;
_MFAEnrollmentID = MFAEnrollmentID;
diff --git a/FirebaseAuth/Sources/Public/FirebaseAuth/FIRAuth.h b/FirebaseAuth/Sources/Public/FirebaseAuth/FIRAuth.h
index 51d0d4fb2cb..9c3927d9157 100644
--- a/FirebaseAuth/Sources/Public/FirebaseAuth/FIRAuth.h
+++ b/FirebaseAuth/Sources/Public/FirebaseAuth/FIRAuth.h
@@ -858,18 +858,6 @@ NS_SWIFT_NAME(Auth)
- (void)revokeTokenWithAuthorizationCode:(NSString *)authorizationCode
completion:(nullable void (^)(NSError *_Nullable error))completion;
-#if TARGET_OS_IOS && !TARGET_OS_MACCATALYST && (!defined(TARGET_OS_XR) || !TARGET_OS_XR)
-/** @fn initializeRecaptchaConfigWithCompletion:completion:
- @brief Initializes reCAPTCHA using the settings configured for the project or
- tenant.
-
- If you change the tenant ID of the `Auth` instance, the configuration will be
- reloaded.
- */
-- (void)initializeRecaptchaConfigWithCompletion:
- (nullable void (^)(NSError *_Nullable error))completion;
-#endif
-
#pragma mark - User sharing
/** @fn useUserAccessGroup:error:
diff --git a/FirebaseAuth/Sources/Public/FirebaseAuth/FIRAuthErrors.h b/FirebaseAuth/Sources/Public/FirebaseAuth/FIRAuthErrors.h
index d6bfa44979f..05b0376585d 100644
--- a/FirebaseAuth/Sources/Public/FirebaseAuth/FIRAuthErrors.h
+++ b/FirebaseAuth/Sources/Public/FirebaseAuth/FIRAuthErrors.h
@@ -409,10 +409,6 @@ typedef NS_ERROR_ENUM(FIRAuthErrorDomain, FIRAuthErrorCode){
*/
FIRAuthErrorCodeEmailChangeNeedsVerification = 17090,
- /** Indicates that the request does not contain a client identifier.
- */
- FIRAuthErrorCodeMissingClientIdentifier = 17093,
-
/** Indicates that the nonce is missing or invalid.
*/
FIRAuthErrorCodeMissingOrInvalidNonce = 17094,
@@ -422,41 +418,9 @@ typedef NS_ERROR_ENUM(FIRAuthErrorDomain, FIRAuthErrorCode){
*/
FIRAuthErrorCodeBlockingCloudFunctionError = 17105,
- /** Indicates that reCAPTCHA Enterprise integration is not enabled for this project.
- */
- FIRAuthErrorCodeRecaptchaNotEnabled = 17200,
-
- /** Indicates that the reCAPTCHA token is missing from the backend request.
- */
- FIRAuthErrorCodeMissingRecaptchaToken = 17201,
-
- /** Indicates that the reCAPTCHA token sent with the backend request is invalid.
- */
- FIRAuthErrorCodeInvalidRecaptchaToken = 17202,
-
- /** Indicates that the requested reCAPTCHA action is invalid.
- */
- FIRAuthErrorCodeInvalidRecaptchaAction = 17203,
-
- /** Indicates that the client type is missing from the request.
- */
- FIRAuthErrorCodeMissingClientType = 17204,
-
- /** Indicates that the reCAPTCHA version is missing from the request.
- */
- FIRAuthErrorCodeMissingRecaptchaVersion = 17205,
-
- /** Indicates that the reCAPTCHA version sent to the backend is invalid.
- */
- FIRAuthErrorCodeInvalidRecaptchaVersion = 17206,
-
- /** Indicates that the request type sent to the backend is invalid.
- */
- FIRAuthErrorCodeInvalidReqType = 17207,
-
- /** Indicates that the reCAPTCHA SDK is not linked to the app.
+ /** Indicates an error for when the client identifier is missing.
*/
- FIRAuthErrorCodeRecaptchaSDKNotLinked = 17208,
+ FIRAuthErrorCodeMissingClientIdentifier = 17993,
/** Indicates an error occurred while attempting to access the keychain.
*/
diff --git a/FirebaseAuth/Sources/Utilities/FIRAuthErrorUtils.h b/FirebaseAuth/Sources/Utilities/FIRAuthErrorUtils.h
index a066fc9e1e6..11136ab3d0a 100644
--- a/FirebaseAuth/Sources/Utilities/FIRAuthErrorUtils.h
+++ b/FirebaseAuth/Sources/Utilities/FIRAuthErrorUtils.h
@@ -509,13 +509,6 @@ NS_ASSUME_NONNULL_BEGIN
*/
+ (NSError *)missingClientIdentifierErrorWithMessage:(nullable NSString *)message;
-/** @fn missingClientTypeErrorWithMessage:
- @brief Constructs an @c NSError with the @c FIRAuthErrorCodeMissingClientType code.
- @param message Error message from the backend, if any.
- @return The NSError instance associated with the given FIRAuthError.
- */
-+ (NSError *)missingClientTypeErrorWithMessage:(nullable NSString *)message;
-
/** @fn captchaCheckFailedErrorWithMessage:
@brief Constructs an @c NSError with the @c FIRAuthErrorCaptchaCheckFailed code.
@param message Error message from the backend, if any.
@@ -615,12 +608,6 @@ NS_ASSUME_NONNULL_BEGIN
+ (NSError *)blockingCloudFunctionServerResponseWithMessage:(nullable NSString *)message;
-/** @fn recaptchaSDKNotLinkedError
- @brief Constructs an @c NSError with the @c FIRAuthErrorCodeRecaptchaSDKNotLinked code.
- @return The NSError instance associated with the given FIRAuthError.
- */
-+ (NSError *)recaptchaSDKNotLinkedError;
-
@end
NS_ASSUME_NONNULL_END
diff --git a/FirebaseAuth/Sources/Utilities/FIRAuthErrorUtils.m b/FirebaseAuth/Sources/Utilities/FIRAuthErrorUtils.m
index 1e7cb3ce186..8610e03523a 100644
--- a/FirebaseAuth/Sources/Utilities/FIRAuthErrorUtils.m
+++ b/FirebaseAuth/Sources/Utilities/FIRAuthErrorUtils.m
@@ -169,6 +169,13 @@
"keychain. The NSLocalizedFailureReasonErrorKey field in the NSError.userInfo dictionary "
"will contain more information about the error encountered";
+/** @var kFIRAuthErrorMessageMissingClientIdentifier
+ @brief Message for @c FIRAuthErrorCodeMissingClientIdentifier error code.
+ */
+static NSString *const kFIRAuthErrorMessageMissingClientIdentifier =
+ @"The request does not contain "
+ "any client identifier.";
+
/** @var kFIRAuthErrorMessageUserTokenExpired
@brief Message for @c FIRAuthErrorCodeTokenExpired error code.
*/
@@ -565,12 +572,6 @@
static NSString *const kFIRAuthErrorMessageRejectedCredential =
@"The request contains malformed or mismatching credentials.";
-/** @var kFIRAuthErrorMessageMissingClientIdentifier
- @brief Error message constant describing @c FIRAuthErrorCodeMissingClientIdentifier errors.
- */
-static NSString *const kFIRAuthErrorMessageMissingClientIdentifier =
- @"The request does not contain a client identifier.";
-
/** @var kFIRAuthErrorMessageMissingOrInvalidNonce
@brief Error message constant describing @c FIRAuthErrorCodeMissingOrInvalidNonce errors.
*/
@@ -597,35 +598,6 @@
static NSString *const kFIRAuthErrorMessageBlockingCloudFunctionReturnedError =
@"Blocking cloud function returned an error.";
-static NSString *const kFIRAuthErrorMessageRecaptchaNotEnabled =
- @"reCAPTCHA Enterprise is not enabled for this project.";
-
-static NSString *const kFIRAuthErrorMessageMissingRecaptchaToken =
- @"The backend request is missing the reCAPTCHA verification token.";
-
-static NSString *const kFIRAuthErrorMessageInvalidRecaptchaToken =
- @"The reCAPTCHA verification token is invalid or has expired.";
-
-static NSString *const kFIRAuthErrorMessageInvalidRecaptchaAction =
- @"The reCAPTCHA verification failed due to an invalid action.";
-
-static NSString *const kFIRAuthErrorMessageMissingClientType =
- @"The request is missing a client type or the client type is invalid.";
-
-static NSString *const kFIRAuthErrorMessageMissingRecaptchaVersion =
- @"The request is missing the reCAPTCHA version parameter.";
-
-static NSString *const kFIRAuthErrorMessageInvalidRecaptchaVersion =
- @"The request specifies an invalid version of reCAPTCHA.";
-
-static NSString *const kFIRAuthErrorMessageInvalidReqType =
- @"The request is not supported or is invalid.";
-
-// TODO(chuanr): point the link to GCIP doc once available.
-static NSString *const kFIRAuthErrorMessageRecaptchaSDKNotLinked =
- @"The reCAPTCHA SDK is not linked to your app. See "
- @"https://cloud.google.com/recaptcha-enterprise/docs/instrument-ios-apps";
-
/** @var FIRAuthErrorDescription
@brief The error descrioption, based on the error code.
@remarks No default case so that we get a compiler warning if a new value was added to the enum.
@@ -662,6 +634,8 @@
return kFIRAuthErrorMessageNetworkError;
case FIRAuthErrorCodeKeychainError:
return kFIRAuthErrorMessageKeychainError;
+ case FIRAuthErrorCodeMissingClientIdentifier:
+ return kFIRAuthErrorMessageMissingClientIdentifier;
case FIRAuthErrorCodeUserTokenExpired:
return kFIRAuthErrorMessageUserTokenExpired;
case FIRAuthErrorCodeUserNotFound:
@@ -782,8 +756,6 @@
return kFIRAuthErrorMessageDynamicLinkNotActivated;
case FIRAuthErrorCodeRejectedCredential:
return kFIRAuthErrorMessageRejectedCredential;
- case FIRAuthErrorCodeMissingClientIdentifier:
- return kFIRAuthErrorMessageMissingClientIdentifier;
case FIRAuthErrorCodeMissingOrInvalidNonce:
return kFIRAuthErrorMessageMissingOrInvalidNonce;
case FIRAuthErrorCodeTenantIDMismatch:
@@ -792,24 +764,6 @@
return kFIRAuthErrorMessageUnsupportedTenantOperation;
case FIRAuthErrorCodeBlockingCloudFunctionError:
return kFIRAuthErrorMessageBlockingCloudFunctionReturnedError;
- case FIRAuthErrorCodeRecaptchaNotEnabled:
- return kFIRAuthErrorMessageRecaptchaNotEnabled;
- case FIRAuthErrorCodeMissingRecaptchaToken:
- return kFIRAuthErrorMessageMissingRecaptchaToken;
- case FIRAuthErrorCodeInvalidRecaptchaToken:
- return kFIRAuthErrorMessageInvalidRecaptchaToken;
- case FIRAuthErrorCodeInvalidRecaptchaAction:
- return kFIRAuthErrorMessageInvalidRecaptchaAction;
- case FIRAuthErrorCodeMissingClientType:
- return kFIRAuthErrorMessageMissingClientType;
- case FIRAuthErrorCodeMissingRecaptchaVersion:
- return kFIRAuthErrorMessageMissingRecaptchaVersion;
- case FIRAuthErrorCodeInvalidRecaptchaVersion:
- return kFIRAuthErrorMessageInvalidRecaptchaVersion;
- case FIRAuthErrorCodeInvalidReqType:
- return kFIRAuthErrorMessageInvalidReqType;
- case FIRAuthErrorCodeRecaptchaSDKNotLinked:
- return kFIRAuthErrorMessageRecaptchaSDKNotLinked;
}
}
@@ -849,8 +803,8 @@
return @"ERROR_NETWORK_REQUEST_FAILED";
case FIRAuthErrorCodeKeychainError:
return @"ERROR_KEYCHAIN_ERROR";
- case FIRAuthErrorCodeMissingClientType:
- return @"ERROR_MISSING_CLIENT_TYPE";
+ case FIRAuthErrorCodeMissingClientIdentifier:
+ return @"ERROR_MISSING_CLIENT_IDENTIFIER";
case FIRAuthErrorCodeUserTokenExpired:
return @"ERROR_USER_TOKEN_EXPIRED";
case FIRAuthErrorCodeUserNotFound:
@@ -971,8 +925,6 @@
return @"ERROR_DYNAMIC_LINK_NOT_ACTIVATED";
case FIRAuthErrorCodeRejectedCredential:
return @"ERROR_REJECTED_CREDENTIAL";
- case FIRAuthErrorCodeMissingClientIdentifier:
- return @"ERROR_MISSING_CLIENT_IDENTIFIER";
case FIRAuthErrorCodeMissingOrInvalidNonce:
return @"ERROR_MISSING_OR_INVALID_NONCE";
case FIRAuthErrorCodeTenantIDMismatch:
@@ -981,22 +933,6 @@
return @"ERROR_UNSUPPORTED_TENANT_OPERATION";
case FIRAuthErrorCodeBlockingCloudFunctionError:
return @"ERROR_BLOCKING_CLOUD_FUNCTION_RETURNED_ERROR";
- case FIRAuthErrorCodeRecaptchaNotEnabled:
- return @"ERROR_RECAPTCHA_NOT_ENABLED";
- case FIRAuthErrorCodeMissingRecaptchaToken:
- return @"ERROR_MISSING_RECAPTCHA_TOKEN";
- case FIRAuthErrorCodeInvalidRecaptchaToken:
- return @"ERROR_INVALID_RECAPTCHA_TOKEN";
- case FIRAuthErrorCodeInvalidRecaptchaAction:
- return @"ERROR_INVALID_RECAPTCHA_ACTION";
- case FIRAuthErrorCodeMissingRecaptchaVersion:
- return @"ERROR_MISSING_RECAPTCHA_VERSION";
- case FIRAuthErrorCodeInvalidRecaptchaVersion:
- return @"ERROR_INVALID_RECAPTCHA_VERSION";
- case FIRAuthErrorCodeInvalidReqType:
- return @"ERROR_INVALID_REQ_TYPE";
- case FIRAuthErrorCodeRecaptchaSDKNotLinked:
- return @"ERROR_RECAPTCHA_SDK_NOT_LINKED";
}
}
@@ -1402,10 +1338,6 @@ + (NSError *)missingClientIdentifierErrorWithMessage:(nullable NSString *)messag
return [self errorWithCode:FIRAuthInternalErrorCodeMissingClientIdentifier message:message];
}
-+ (NSError *)missingClientTypeErrorWithMessage:(nullable NSString *)message {
- return [self errorWithCode:FIRAuthInternalErrorCodeMissingClientType message:message];
-}
-
+ (NSError *)captchaCheckFailedErrorWithMessage:(nullable NSString *)message {
return [self errorWithCode:FIRAuthInternalErrorCodeCaptchaCheckFailed message:message];
}
@@ -1512,11 +1444,6 @@ + (NSError *)blockingCloudFunctionServerResponseWithMessage:(nullable NSString *
return [self errorWithCode:FIRAuthInternalErrorBlockingCloudFunctionError message:errorMessage];
}
-+ (NSError *)recaptchaSDKNotLinkedError {
- return [self errorWithCode:FIRAuthInternalErrorCodeRecaptchaSDKNotLinked
- message:kFIRAuthErrorMessageRecaptchaSDKNotLinked];
-}
-
@end
NS_ASSUME_NONNULL_END
diff --git a/FirebaseAuth/Sources/Utilities/FIRAuthInternalErrors.h b/FirebaseAuth/Sources/Utilities/FIRAuthInternalErrors.h
index 82b99b6487d..96046f8a33f 100644
--- a/FirebaseAuth/Sources/Utilities/FIRAuthInternalErrors.h
+++ b/FirebaseAuth/Sources/Utilities/FIRAuthInternalErrors.h
@@ -90,11 +90,11 @@ typedef NS_ENUM(NSInteger, FIRAuthInternalErrorCode) {
FIRAuthInternalErrorCodeKeychainError = FIRAuthPublicErrorCodeFlag |
FIRAuthErrorCodeKeychainError,
- /** @var FIRAuthInternalErrorCodeMissingClientType
- @brief Indicates an error for when the client type is missing.
+ /** @var FIRAuthInternalErrorCodeMissingClientIdentifier
+ @brief Indicates an error for when the client identifier is missing.
*/
- FIRAuthInternalErrorCodeMissingClientType = FIRAuthPublicErrorCodeFlag |
- FIRAuthErrorCodeMissingClientType,
+ FIRAuthInternalErrorCodeMissingClientIdentifier = FIRAuthPublicErrorCodeFlag |
+ FIRAuthErrorCodeMissingClientIdentifier,
/** @var FIRAuthInternalErrorCodeInternalError
@brief An internal error occurred.
@@ -441,11 +441,6 @@ typedef NS_ENUM(NSInteger, FIRAuthInternalErrorCode) {
FIRAuthInternalErrorCodeEmailChangeNeedsVerification =
FIRAuthPublicErrorCodeFlag | FIRAuthErrorCodeEmailChangeNeedsVerification,
- /** Indicates that the request does not contain any client identifier.
- */
- FIRAuthInternalErrorCodeMissingClientIdentifier = FIRAuthPublicErrorCodeFlag |
- FIRAuthErrorCodeMissingClientIdentifier,
-
/** Indicates that the nonce is missing or invalid.
*/
FIRAuthInternalErrorCodeMissingOrInvalidNonce = FIRAuthPublicErrorCodeFlag |
@@ -487,27 +482,12 @@ typedef NS_ENUM(NSInteger, FIRAuthInternalErrorCode) {
FIRAuthInternalErrorBlockingCloudFunctionError = FIRAuthPublicErrorCodeFlag |
FIRAuthErrorCodeBlockingCloudFunctionError,
- /** Indicates that the recaptcha score sent to backend is invalid.
- */
- FIRAuthInternalErrorCodeInvalidRecaptchaScore = FIRAuthPublicErrorCodeFlag |
- FIRAuthErrorCodeCaptchaCheckFailed,
-
- /** Indicates that the recaptcha integration is not enabled for this project.
- */
- FIRAuthInternalErrorCodeRecaptchaNotEnabled = FIRAuthPublicErrorCodeFlag |
- FIRAuthErrorCodeRecaptchaNotEnabled,
-
- /** Indicates that the recaptcha sdk is not linked to the app.
- */
- FIRAuthInternalErrorCodeRecaptchaSDKNotLinked = FIRAuthPublicErrorCodeFlag |
- FIRAuthErrorCodeRecaptchaSDKNotLinked,
-
/** @var FIRAuthInternalErrorCodeRPCRequestEncodingError
- @brief Indicates an error encoding the RPC request.
- @remarks This is typically due to some sort of unexpected input value.
+ @brief Indicates an error encoding the RPC request.
+ @remarks This is typically due to some sort of unexpected input value.
- See the @c NSUnderlyingError value in the @c NSError.userInfo dictionary for details.
- */
+ See the @c NSUnderlyingError value in the @c NSError.userInfo dictionary for details.
+ */
FIRAuthInternalErrorCodeRPCRequestEncodingError = 1,
/** @var FIRAuthInternalErrorCodeJSONSerializationError
diff --git a/FirebaseAuth/Sources/Utilities/FIRAuthRecaptchaVerifier.h b/FirebaseAuth/Sources/Utilities/FIRAuthRecaptchaVerifier.h
deleted file mode 100644
index 5a279f71632..00000000000
--- a/FirebaseAuth/Sources/Utilities/FIRAuthRecaptchaVerifier.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright 2023 Google LLC
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#import
-
-#if TARGET_OS_IOS && !TARGET_OS_MACCATALYST && (!defined(TARGET_OS_XR) || !TARGET_OS_XR)
-#import
-
-#import "FirebaseAuth/Sources/Backend/FIRIdentityToolkitRequest.h"
-
-NS_ASSUME_NONNULL_BEGIN
-
-@interface FIRAuthRecaptchaConfig : NSObject
-
-@property(nonatomic, nonnull, copy) NSString *siteKey;
-
-@property(nonatomic, nonnull, strong) NSDictionary *enablementStatus;
-
-@end
-
-typedef void (^FIRAuthRecaptchaTokenCallback)(NSString *_Nullable token, NSError *_Nullable error);
-
-typedef void (^FIRAuthRecaptchaConfigCallback)(NSError *_Nullable error);
-
-typedef void (^FIRAuthInjectRequestCallback)(FIRIdentityToolkitRequest *request);
-
-typedef NS_ENUM(NSInteger, FIRAuthRecaptchaProvider) {
- FIRAuthRecaptchaProviderPassword,
-};
-
-typedef NS_ENUM(NSInteger, FIRAuthRecaptchaAction) {
- FIRAuthRecaptchaActionDefault,
- FIRAuthRecaptchaActionSignInWithPassword,
- FIRAuthRecaptchaActionGetOobCode,
- FIRAuthRecaptchaActionSignUpPassword
-};
-
-@interface FIRAuthRecaptchaVerifier : NSObject
-
-@property(nonatomic, weak, nullable) FIRAuth *auth;
-
-@property(nonatomic, strong, nullable) FIRAuthRecaptchaConfig *agentConfig;
-
-@property(nonatomic, strong, nullable)
- NSMutableDictionary *tenantConfigs;
-
-@property(nonatomic, strong) id recaptchaClient;
-
-- (void)verifyForceRefresh:(BOOL)forceRefresh
- action:(FIRAuthRecaptchaAction)action
- completion:(nullable FIRAuthRecaptchaTokenCallback)completion;
-
-- (void)injectRecaptchaFields:(FIRIdentityToolkitRequest *)request
- provider:(FIRAuthRecaptchaProvider)provider
- action:(FIRAuthRecaptchaAction)action
- completion:(nullable FIRAuthInjectRequestCallback)completion;
-
-- (BOOL)enablementStatusForProvider:(FIRAuthRecaptchaProvider)provider;
-
-+ (id)sharedRecaptchaVerifier:(nullable FIRAuth *)auth;
-
-@end
-
-NS_ASSUME_NONNULL_END
-
-#endif
diff --git a/FirebaseAuth/Sources/Utilities/FIRAuthRecaptchaVerifier.m b/FirebaseAuth/Sources/Utilities/FIRAuthRecaptchaVerifier.m
deleted file mode 100644
index dc8627a5179..00000000000
--- a/FirebaseAuth/Sources/Utilities/FIRAuthRecaptchaVerifier.m
+++ /dev/null
@@ -1,264 +0,0 @@
-/*
- * Copyright 2023 Google LLC
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#import "FirebaseAuth/Sources/Utilities/FIRAuthRecaptchaVerifier.h"
-
-#if TARGET_OS_IOS && !TARGET_OS_MACCATALYST && (!defined(TARGET_OS_XR) || !TARGET_OS_XR)
-
-#import "FirebaseAuth/Sources/Auth/FIRAuth_Internal.h"
-#import "FirebaseAuth/Sources/Backend/FIRAuthBackend.h"
-#import "FirebaseAuth/Sources/Backend/RPC/FIRGetRecaptchaConfigRequest.h"
-#import "FirebaseAuth/Sources/Backend/RPC/FIRGetRecaptchaConfigResponse.h"
-#import "FirebaseAuth/Sources/Backend/RPC/FIRVerifyPasswordRequest.h"
-#import "FirebaseAuth/Sources/Public/FirebaseAuth/FIRAuth.h"
-#import "FirebaseAuth/Sources/Utilities/FIRAuthErrorUtils.h"
-
-#import
-#import
-
-static const NSDictionary *providerToStringMap;
-static const NSDictionary *actionToStringMap;
-
-static NSString *const kClientType = @"CLIENT_TYPE_IOS";
-static NSString *const kRecaptchaVersion = @"RECAPTCHA_ENTERPRISE";
-static NSString *const kFakeToken = @"NO_RECAPTCHA";
-
-@implementation FIRAuthRecaptchaConfig
-
-@end
-
-@implementation FIRAuthRecaptchaVerifier
-
-+ (id)sharedRecaptchaVerifier:(nullable FIRAuth *)auth {
- static FIRAuthRecaptchaVerifier *sharedRecaptchaVerifier = nil;
- static dispatch_once_t onceToken;
- dispatch_once(&onceToken, ^{
- sharedRecaptchaVerifier = [[self alloc] init];
-
- providerToStringMap = @{@(FIRAuthRecaptchaProviderPassword) : @"EMAIL_PASSWORD_PROVIDER"};
-
- actionToStringMap = @{
- @(FIRAuthRecaptchaActionSignInWithPassword) : @"signInWithPassword",
- @(FIRAuthRecaptchaActionGetOobCode) : @"getOobCode",
- @(FIRAuthRecaptchaActionSignUpPassword) : @"signUpPassword"
- };
- });
- if (sharedRecaptchaVerifier.auth != auth) {
- sharedRecaptchaVerifier.agentConfig = nil;
- sharedRecaptchaVerifier.tenantConfigs = nil;
- sharedRecaptchaVerifier.auth = auth;
- }
- return sharedRecaptchaVerifier;
-}
-
-- (NSString *)siteKey {
- if (self.auth.tenantID == nil) {
- return self->_agentConfig.siteKey;
- } else {
- FIRAuthRecaptchaConfig *config = self->_tenantConfigs[self.auth.tenantID];
- if (config) {
- return config.siteKey;
- } else {
- return nil;
- }
- }
-}
-
-- (BOOL)enablementStatusForProvider:(FIRAuthRecaptchaProvider)provider {
- if (self.auth.tenantID == nil) {
- return [self->_agentConfig.enablementStatus[providerToStringMap[@(provider)]] boolValue];
- } else {
- return
- [self->_tenantConfigs[self.auth.tenantID].enablementStatus[providerToStringMap[@(provider)]]
- boolValue];
- }
-}
-
-- (void)verifyForceRefresh:(BOOL)forceRefresh
- action:(FIRAuthRecaptchaAction)action
- completion:(nullable FIRAuthRecaptchaTokenCallback)completion {
- [self
- retrieveRecaptchaConfigForceRefresh:forceRefresh
- completion:^(NSError *_Nullable error) {
- if (error) {
- completion(nil, error);
- }
- if (!self.recaptchaClient) {
- NSString *siteKey = [self siteKey];
- Class RecaptchaClass = NSClassFromString(@"Recaptcha");
- if (RecaptchaClass) {
- SEL selector =
- NSSelectorFromString(@"getClientWithSiteKey:completion:");
- if ([RecaptchaClass respondsToSelector:selector]) {
- void (*funcWithoutTimeout)(
- id, SEL, NSString *,
- void (^)(
- id _Nullable recaptchaClient,
- NSError *_Nullable error)) =
- (void *)[RecaptchaClass methodForSelector:selector];
- funcWithoutTimeout(
- RecaptchaClass, selector, siteKey,
- ^(id _Nullable recaptchaClient,
- NSError *_Nullable error) {
- if (recaptchaClient) {
- self.recaptchaClient = recaptchaClient;
- [self retrieveRecaptchaTokenWithAction:action
- completion:completion];
- } else if (error) {
- completion(nil, error);
- }
- });
- } else {
- NSLog(@"reCAPTCHA verification faled because reCAPTCHA SDK "
- @"not linked.");
- completion(nil,
- [FIRAuthErrorUtils recaptchaSDKNotLinkedError]);
- }
- } else {
- NSLog(@"reCAPTCHA verification faled because reCAPTCHA SDK "
- @"not linked.");
- completion(nil,
- [FIRAuthErrorUtils recaptchaSDKNotLinkedError]);
- }
- } else {
- NSLog(@"reCAPTCHA verification succeeded.");
- [self retrieveRecaptchaTokenWithAction:action
- completion:completion];
- }
- }];
-}
-
-- (void)retrieveRecaptchaConfigForceRefresh:(BOOL)forceRefresh
- completion:(nullable FIRAuthRecaptchaConfigCallback)completion {
- if (!forceRefresh) {
- if (self.auth.tenantID == nil && _agentConfig != nil) {
- completion(nil);
- return;
- }
- if (self.auth.tenantID != nil && _tenantConfigs[self.auth.tenantID] != nil) {
- completion(nil);
- return;
- }
- }
- FIRGetRecaptchaConfigRequest *request = [[FIRGetRecaptchaConfigRequest alloc]
- initWithRequestConfiguration:self.auth.requestConfiguration];
- [FIRAuthBackend
- getRecaptchaConfig:request
- callback:^(FIRGetRecaptchaConfigResponse *_Nullable response,
- NSError *_Nullable error) {
- if (error) {
- NSLog(@"reCAPTCHA config retrieval failed.");
- completion(error);
- }
- NSLog(@"reCAPTCHA config retrieval succeeded.");
- FIRAuthRecaptchaConfig *config = [[FIRAuthRecaptchaConfig alloc] init];
- // Response's site key is of the format projects//keys/'
- config.siteKey = [response.recaptchaKey componentsSeparatedByString:@"/"][3];
- NSMutableDictionary *tmpEnablementStatus = [NSMutableDictionary dictionary];
- for (NSDictionary *state in response.enforcementState) {
- if ([state[@"provider"]
- isEqualToString:providerToStringMap[
- @(FIRAuthRecaptchaProviderPassword)]]) {
- if ([state[@"enforcementState"] isEqualToString:@"ENFORCE"]) {
- tmpEnablementStatus[state[@"provider"]] = @YES;
- } else if ([state[@"enforcementState"] isEqualToString:@"AUDIT"]) {
- tmpEnablementStatus[state[@"provider"]] = @YES;
- } else if ([state[@"enforcementState"] isEqualToString:@"OFF"]) {
- tmpEnablementStatus[state[@"provider"]] = @NO;
- }
- }
- }
- config.enablementStatus = tmpEnablementStatus;
-
- if (self.auth.tenantID == nil) {
- self->_agentConfig = config;
- completion(nil);
- return;
- } else {
- if (!self->_tenantConfigs) {
- self->_tenantConfigs = [[NSMutableDictionary alloc] init];
- }
- self->_tenantConfigs[self.auth.tenantID] = config;
- completion(nil);
- return;
- }
- }];
-}
-
-- (void)retrieveRecaptchaTokenWithAction:(FIRAuthRecaptchaAction)action
- completion:(nullable FIRAuthRecaptchaTokenCallback)completion {
- Class RecaptchaActionClass = NSClassFromString(@"RecaptchaAction");
- if (RecaptchaActionClass) {
- SEL customActionSelector = NSSelectorFromString(@"initWithCustomAction:");
-
- if ([RecaptchaActionClass instancesRespondToSelector:customActionSelector]) {
- // Initialize with a custom action
- id (*funcWithCustomAction)(id, SEL, NSString *) =
- (id(*)(id, SEL,
- NSString *))[RecaptchaActionClass instanceMethodForSelector:customActionSelector];
-
- id customAction = funcWithCustomAction(
- [[RecaptchaActionClass alloc] init], customActionSelector, actionToStringMap[@(action)]);
-
- if (customAction) {
- [self.recaptchaClient
- execute:customAction
- completion:^(NSString *_Nullable token, NSError *_Nullable error) {
- if (!error) {
- NSLog(@"reCAPTCHA token retrieval succeeded.");
- completion(token, nil);
- return;
- } else {
- NSLog(@"reCAPTCHA token retrieval failed. NO_RECAPTCHA sent as the fake code.");
- completion(kFakeToken, nil);
- }
- }];
- }
- } else {
- completion(nil, [FIRAuthErrorUtils recaptchaSDKNotLinkedError]);
- }
- } else {
- completion(nil, [FIRAuthErrorUtils recaptchaSDKNotLinkedError]);
- }
-}
-
-- (void)injectRecaptchaFields:(FIRIdentityToolkitRequest *)request
- provider:(FIRAuthRecaptchaProvider)provider
- action:(FIRAuthRecaptchaAction)action
- completion:(nullable FIRAuthInjectRequestCallback)completion {
- [self retrieveRecaptchaConfigForceRefresh:false
- completion:^(NSError *_Nullable error) {
- if ([self enablementStatusForProvider:provider]) {
- [self verifyForceRefresh:false
- action:action
- completion:^(NSString *_Nullable token,
- NSError *_Nullable error) {
- [request
- injectRecaptchaFields:token
- recaptchaVersion:kRecaptchaVersion];
- completion(request);
- }];
- } else {
- [request injectRecaptchaFields:nil
- recaptchaVersion:kRecaptchaVersion];
- completion(request);
- }
- }];
-}
-
-@end
-
-#endif
diff --git a/FirebaseAuth/Tests/Sample/Podfile b/FirebaseAuth/Tests/Sample/Podfile
index ce2c917866d..6ee18be51c9 100644
--- a/FirebaseAuth/Tests/Sample/Podfile
+++ b/FirebaseAuth/Tests/Sample/Podfile
@@ -17,7 +17,6 @@ target 'AuthSample' do
pod 'FBSDKLoginKit', '< 13'
pod 'GoogleSignIn', '~> 6'
pod 'GTMSessionFetcher/Core'
- pod 'RecaptchaEnterprise', '~> 18.2.0'
target 'Auth_ApiTests' do
inherit! :search_paths
diff --git a/FirebaseAuth/Tests/Sample/Sample/AuthSample-Bridging-Header.h b/FirebaseAuth/Tests/Sample/Sample/AuthSample-Bridging-Header.h
deleted file mode 100644
index 229724c7f2c..00000000000
--- a/FirebaseAuth/Tests/Sample/Sample/AuthSample-Bridging-Header.h
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * Copyright 2022 Google LLC
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
diff --git a/FirebaseAuth/Tests/Sample/Sample/Dummy.swift b/FirebaseAuth/Tests/Sample/Sample/Dummy.swift
deleted file mode 100644
index bddf99ec845..00000000000
--- a/FirebaseAuth/Tests/Sample/Sample/Dummy.swift
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * Copyright 2022 Google LLC
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import Foundation
diff --git a/FirebaseAuth/Tests/Sample/Sample/MainViewController+Auth.m b/FirebaseAuth/Tests/Sample/Sample/MainViewController+Auth.m
index e1f61730022..091da828633 100644
--- a/FirebaseAuth/Tests/Sample/Sample/MainViewController+Auth.m
+++ b/FirebaseAuth/Tests/Sample/Sample/MainViewController+Auth.m
@@ -29,9 +29,7 @@ - (StaticContentTableViewSection *)authSection {
[StaticContentTableViewCell cellWithTitle:@"Sign in Anonymously"
action:^{ [weakSelf signInAnonymously]; }],
[StaticContentTableViewCell cellWithTitle:@"Sign out"
- action:^{ [weakSelf signOut]; }],
- [StaticContentTableViewCell cellWithTitle:@"Initialize Recaptcha Config"
- action:^{ [weakSelf initializeRecaptchaConfig]; }]
+ action:^{ [weakSelf signOut]; }]
]];
}
@@ -74,16 +72,6 @@ - (void)signOut {
[[AppManager auth] signOut:NULL];
}
-- (void)initializeRecaptchaConfig {
- [[AppManager auth] initializeRecaptchaConfigWithCompletion:^(NSError * _Nullable error) {
- if (error) {
- [self logFailure:@"Initializing Recaptcha config failed" error:error];
- } else {
- [self logSuccess:@"Initializing Recaptcha config succeeded."];
- }
- }];
-}
-
@end
NS_ASSUME_NONNULL_END
diff --git a/FirebaseAuth/Tests/Sample/SwiftApiTests/SwiftAPI.swift b/FirebaseAuth/Tests/Sample/SwiftApiTests/SwiftAPI.swift
index d4f4913af0d..cbfa884374f 100644
--- a/FirebaseAuth/Tests/Sample/SwiftApiTests/SwiftAPI.swift
+++ b/FirebaseAuth/Tests/Sample/SwiftApiTests/SwiftAPI.swift
@@ -208,15 +208,7 @@ class AuthAPI_hOnlyTests: XCTestCase {
_ = AuthErrorCode.unsupportedFirstFactor
_ = AuthErrorCode.emailChangeNeedsVerification
_ = AuthErrorCode.missingOrInvalidNonce
-
- _ = AuthErrorCode.recaptchaNotEnabled
- _ = AuthErrorCode.missingRecaptchaToken
- _ = AuthErrorCode.invalidRecaptchaToken
- _ = AuthErrorCode.invalidRecaptchaAction
- _ = AuthErrorCode.missingClientType
- _ = AuthErrorCode.missingRecaptchaVersion
- _ = AuthErrorCode.invalidRecaptchaVersion
- _ = AuthErrorCode.invalidReqType
+ _ = AuthErrorCode.missingClientIdentifier
_ = AuthErrorCode.keychainError
_ = AuthErrorCode.internalError
_ = AuthErrorCode.malformedJWT
diff --git a/FirebaseAuth/Tests/Unit/FIRAuthBackendRPCImplementationTests.m b/FirebaseAuth/Tests/Unit/FIRAuthBackendRPCImplementationTests.m
index ec2c6ae8868..0a74af305ff 100644
--- a/FirebaseAuth/Tests/Unit/FIRAuthBackendRPCImplementationTests.m
+++ b/FirebaseAuth/Tests/Unit/FIRAuthBackendRPCImplementationTests.m
@@ -124,7 +124,7 @@
*/
@interface FIRAuthBackendRPCImplementation : NSObject
-/** @fn callWithRequest:response:callback:
+/** @fn postWithRequest:response:callback:
@brief Calls the RPC using HTTP POST.
@remarks Possible error responses:
@see FIRAuthInternalErrorCodeRPCRequestEncodingError
@@ -137,7 +137,7 @@ @interface FIRAuthBackendRPCImplementation : NSObject )request
+- (void)postWithRequest:(id)request
response:(id)response
callback:(void (^)(NSError *error))callback;
@@ -387,7 +387,7 @@ - (BOOL)setWithDictionary:(NSDictionary *)dictionary error:(NSError *_Nullable *
/** @class FIRAuthBackendRPCImplementationTests
@brief This set of unit tests is designed primarily to test the possible outcomes of the
- @c FIRAuthBackendRPCImplementation.callWithRequest:response:callback: method.
+ @c FIRAuthBackendRPCImplementation.postWithRequest:response:callback: method.
*/
@interface FIRAuthBackendRPCImplementationTests : XCTestCase
@end
@@ -419,7 +419,7 @@ - (void)tearDown {
}
/** @fn testRequest_IncludesHeartbeatPayload_WhenHeartbeatsNeedSending
- @brief This test checks the behavior of @c callWithRequest:response:callback:
+ @brief This test checks the behavior of @c postWithRequest:response:callback:
to verify that a heartbeats payload is attached as a header to an
outgoing request when there are stored heartbeats that need sending.
*/
@@ -449,7 +449,7 @@ - (void)testRequest_IncludesHeartbeatPayload_WhenHeartbeatsNeedSending {
__block NSError *callbackError;
__block BOOL callbackInvoked;
- [_RPCImplementation callWithRequest:request
+ [_RPCImplementation postWithRequest:request
response:response
callback:^(NSError *error) {
callbackInvoked = YES;
@@ -485,7 +485,7 @@ - (void)testRequest_IncludesAppCheckHeader {
__block NSError *callbackError;
__block BOOL callbackInvoked;
- [_RPCImplementation callWithRequest:request
+ [_RPCImplementation postWithRequest:request
response:response
callback:^(NSError *error) {
callbackInvoked = YES;
@@ -498,7 +498,7 @@ - (void)testRequest_IncludesAppCheckHeader {
}
/** @fn testRequest_DoesNotIncludeAHeartbeatPayload_WhenNoHeartbeatsNeedSending
- @brief This test checks the behavior of @c callWithRequest:response:callback:
+ @brief This test checks the behavior of @c postWithRequest:response:callback:
to verify that a request header does not contain heartbeat data in the
case that there are no stored heartbeats that need sending.
*/
@@ -528,7 +528,7 @@ - (void)testRequest_DoesNotIncludeAHeartbeatPayload_WhenNoHeartbeatsNeedSending
__block NSError *callbackError;
__block BOOL callbackInvoked;
- [_RPCImplementation callWithRequest:request
+ [_RPCImplementation postWithRequest:request
response:response
callback:^(NSError *error) {
callbackInvoked = YES;
@@ -540,7 +540,7 @@ - (void)testRequest_DoesNotIncludeAHeartbeatPayload_WhenNoHeartbeatsNeedSending
}
/** @fn testRequestEncodingError
- @brief This test checks the behaviour of @c callWithRequest:response:callback: when the
+ @brief This test checks the behaviour of @c postWithRequest:response:callback: when the
request passed returns an error during it's unencodedHTTPRequestBodyWithError: method.
The error returned should be delivered to the caller without any change.
*/
@@ -553,7 +553,7 @@ - (void)testRequestEncodingError {
__block NSError *callbackError;
__block BOOL callbackInvoked;
- [_RPCImplementation callWithRequest:request
+ [_RPCImplementation postWithRequest:request
response:response
callback:^(NSError *error) {
callbackInvoked = YES;
@@ -587,7 +587,7 @@ - (void)testRequestEncodingError {
}
/** @fn testBodyDataSerializationError
- @brief This test checks the behaviour of @c callWithRequest:response:callback: when the
+ @brief This test checks the behaviour of @c postWithRequest:response:callback: when the
request returns an object which isn't serializable by @c NSJSONSerialization.
The error from @c NSJSONSerialization should be returned as the underlyingError for an
@c NSError with the code @c FIRAuthErrorCodeJSONSerializationError.
@@ -598,7 +598,7 @@ - (void)testBodyDataSerializationError {
__block NSError *callbackError;
__block BOOL callbackInvoked;
- [_RPCImplementation callWithRequest:request
+ [_RPCImplementation postWithRequest:request
response:response
callback:^(NSError *error) {
callbackInvoked = YES;
@@ -639,7 +639,7 @@ - (void)testNetworkError {
__block NSError *callbackError;
__block BOOL callbackInvoked;
- [_RPCImplementation callWithRequest:request
+ [_RPCImplementation postWithRequest:request
response:response
callback:^(NSError *error) {
callbackInvoked = YES;
@@ -675,7 +675,7 @@ - (void)testNetworkError {
}
/** @fn testUnparsableErrorResponse
- @brief This test checks the behaviour of @c callWithRequest:response:callback: when the
+ @brief This test checks the behaviour of @c postWithRequest:response:callback: when the
response isn't deserializable by @c NSJSONSerialization and an error
condition (with an associated error response message) was expected. We are expecting to
receive the original network error wrapped in an @c NSError with the code
@@ -687,7 +687,7 @@ - (void)testUnparsableErrorResponse {
__block NSError *callbackError;
__block BOOL callbackInvoked;
- [_RPCImplementation callWithRequest:request
+ [_RPCImplementation postWithRequest:request
response:response
callback:^(NSError *error) {
callbackInvoked = YES;
@@ -724,7 +724,7 @@ - (void)testUnparsableErrorResponse {
}
/** @fn testUnparsableSuccessResponse
- @brief This test checks the behaviour of @c callWithRequest:response:callback: when the
+ @brief This test checks the behaviour of @c postWithRequest:response:callback: when the
response isn't deserializable by @c NSJSONSerialization and no error
condition was indicated. We are expecting to
receive the @c NSJSONSerialization error wrapped in an @c NSError with the code
@@ -736,7 +736,7 @@ - (void)testUnparsableSuccessResponse {
__block NSError *callbackError;
__block BOOL callbackInvoked;
- [_RPCImplementation callWithRequest:request
+ [_RPCImplementation postWithRequest:request
response:response
callback:^(NSError *error) {
callbackInvoked = YES;
@@ -770,7 +770,7 @@ - (void)testUnparsableSuccessResponse {
}
/** @fn testNonDictionaryErrorResponse
- @brief This test checks the behaviour of @c callWithRequest:response:callback: when the
+ @brief This test checks the behaviour of @c postWithRequest:response:callback: when the
response deserialized by @c NSJSONSerialization is not a dictionary, and an error was
expected. We are expecting to receive the original network error wrapped in an @c NSError
with the code @c FIRAuthInternalErrorCodeUnexpectedErrorResponse with the decoded response
@@ -783,7 +783,7 @@ - (void)testNonDictionaryErrorResponse {
__block NSError *callbackError;
__block BOOL callbackInvoked;
- [_RPCImplementation callWithRequest:request
+ [_RPCImplementation postWithRequest:request
response:response
callback:^(NSError *error) {
callbackInvoked = YES;
@@ -823,7 +823,7 @@ - (void)testNonDictionaryErrorResponse {
}
/** @fn testNonDictionarySuccessResponse
- @brief This test checks the behaviour of @c callWithRequest:response:callback: when the
+ @brief This test checks the behaviour of @c postWithRequest:response:callback: when the
response deserialized by @c NSJSONSerialization is not a dictionary, and no error was
expected. We are expecting to receive an @c NSError with the code
@c FIRAuthErrorCodeUnexpectedServerResponse with the decoded response in the
@@ -836,7 +836,7 @@ - (void)testNonDictionarySuccessResponse {
__block NSError *callbackError;
__block BOOL callbackInvoked;
- [_RPCImplementation callWithRequest:request
+ [_RPCImplementation postWithRequest:request
response:response
callback:^(NSError *error) {
callbackInvoked = YES;
@@ -873,7 +873,7 @@ - (void)testNonDictionarySuccessResponse {
}
/** @fn testCaptchaRequiredResponse
- @brief This test checks the behaviour of @c callWithRequest:response:callback: when the
+ @brief This test checks the behaviour of @c postWithRequest:response:callback: when the
we get an error message indicating captcha is required. The backend should not be returning
this error to mobile clients. If it does, we should wrap it in an @c NSError with the code
@c FIRAuthInternalErrorCodeUnexpectedErrorResponse with the decoded error message in the
@@ -886,7 +886,7 @@ - (void)testCaptchaRequiredResponse {
__block NSError *callbackError;
__block BOOL callbackInvoked;
- [_RPCImplementation callWithRequest:request
+ [_RPCImplementation postWithRequest:request
response:response
callback:^(NSError *error) {
callbackInvoked = YES;
@@ -922,7 +922,7 @@ - (void)testCaptchaRequiredResponse {
}
/** @fn testCaptchaCheckFailedResponse
- @brief This test checks the behaviour of @c callWithRequest:response:callback: when the
+ @brief This test checks the behaviour of @c postWithRequest:response:callback: when the
we get an error message indicating captcha check failed. The backend should not be returning
this error to mobile clients. If it does, we should wrap it in an @c NSError with the code
@c FIRAuthErrorCodeUnexpectedServerResponse with the decoded error message in the
@@ -935,7 +935,7 @@ - (void)testCaptchaCheckFailedResponse {
__block NSError *callbackError;
__block BOOL callbackInvoked;
- [_RPCImplementation callWithRequest:request
+ [_RPCImplementation postWithRequest:request
response:response
callback:^(NSError *error) {
callbackInvoked = YES;
@@ -953,7 +953,7 @@ - (void)testCaptchaCheckFailedResponse {
}
/** @fn testCaptchaRequiredInvalidPasswordResponse
- @brief This test checks the behaviour of @c callWithRequest:response:callback: when the
+ @brief This test checks the behaviour of @c postWithRequest:response:callback: when the
we get an error message indicating captcha is required and an invalid password was entered.
The backend should not be returning this error to mobile clients. If it does, we should wrap
it in an @c NSError with the code
@@ -967,7 +967,7 @@ - (void)testCaptchaRequiredInvalidPasswordResponse {
__block NSError *callbackError;
__block BOOL callbackInvoked;
- [_RPCImplementation callWithRequest:request
+ [_RPCImplementation postWithRequest:request
response:response
callback:^(NSError *error) {
callbackInvoked = YES;
@@ -1004,7 +1004,7 @@ - (void)testCaptchaRequiredInvalidPasswordResponse {
}
/** @fn testDecodableErrorResponseWithUnknownMessage
- @brief This test checks the behaviour of @c callWithRequest:response:callback: when the
+ @brief This test checks the behaviour of @c postWithRequest:response:callback: when the
response deserialized by @c NSJSONSerialization represents a valid error response (and an
error was indicated) but we didn't receive an error message we know about. We are expecting
to receive the original network error wrapped in an @c NSError with the code
@@ -1018,7 +1018,7 @@ - (void)testDecodableErrorResponseWithUnknownMessage {
__block NSError *callbackError;
__block BOOL callbackInvoked;
- [_RPCImplementation callWithRequest:request
+ [_RPCImplementation postWithRequest:request
response:response
callback:^(NSError *error) {
callbackInvoked = YES;
@@ -1056,7 +1056,7 @@ - (void)testDecodableErrorResponseWithUnknownMessage {
}
/** @fn testErrorResponseWithNoErrorMessage
- @brief This test checks the behaviour of @c callWithRequest:response:callback: when the
+ @brief This test checks the behaviour of @c postWithRequest:response:callback: when the
response deserialized by @c NSJSONSerialization is a dictionary, and an error was indicated,
but no error information was present in the decoded response. We are expecting to receive
the original network error wrapped in an @c NSError with the code
@@ -1070,7 +1070,7 @@ - (void)testErrorResponseWithNoErrorMessage {
__block NSError *callbackError;
__block BOOL callbackInvoked;
- [_RPCImplementation callWithRequest:request
+ [_RPCImplementation postWithRequest:request
response:response
callback:^(NSError *error) {
callbackInvoked = YES;
@@ -1105,7 +1105,7 @@ - (void)testErrorResponseWithNoErrorMessage {
}
/** @fn testClientErrorResponse
- @brief This test checks the behaviour of @c callWithRequest:response:callback: when the
+ @brief This test checks the behaviour of @c postWithRequest:response:callback: when the
response contains a client error specified by an error messsage sent from the backend.
*/
- (void)testClientErrorResponse {
@@ -1114,7 +1114,7 @@ - (void)testClientErrorResponse {
__block NSError *callbackerror;
__block BOOL callBackInvoked;
- [_RPCImplementation callWithRequest:request
+ [_RPCImplementation postWithRequest:request
response:response
callback:^(NSError *error) {
callBackInvoked = YES;
@@ -1133,7 +1133,7 @@ - (void)testClientErrorResponse {
}
/** @fn testUndecodableSuccessResponse
- @brief This test checks the behaviour of @c callWithRequest:response:callback: when the
+ @brief This test checks the behaviour of @c postWithRequest:response:callback: when the
response isn't decodable by the response class but no error condition was expected. We are
expecting to receive an @c NSError with the code
@c FIRAuthErrorCodeUnexpectedServerResponse and the error from @c setWithDictionary:error:
@@ -1145,7 +1145,7 @@ - (void)testUndecodableSuccessResponse {
__block NSError *callbackError;
__block BOOL callbackInvoked;
- [_RPCImplementation callWithRequest:request
+ [_RPCImplementation postWithRequest:request
response:response
callback:^(NSError *error) {
callbackInvoked = YES;
@@ -1185,7 +1185,7 @@ - (void)testSuccessfulResponse {
__block NSError *callbackError;
__block BOOL callbackInvoked;
- [_RPCImplementation callWithRequest:request
+ [_RPCImplementation postWithRequest:request
response:response
callback:^(NSError *error) {
callbackInvoked = YES;
diff --git a/FirebaseAuth/Tests/Unit/FIRAuthTests.m b/FirebaseAuth/Tests/Unit/FIRAuthTests.m
index e28286fa6e5..f261feafaab 100644
--- a/FirebaseAuth/Tests/Unit/FIRAuthTests.m
+++ b/FirebaseAuth/Tests/Unit/FIRAuthTests.m
@@ -63,7 +63,6 @@
#import "FirebaseAuth/Sources/Backend/RPC/FIRVerifyPhoneNumberResponse.h"
#import "FirebaseAuth/Sources/User/FIRUser_Internal.h"
#import "FirebaseAuth/Sources/Utilities/FIRAuthErrorUtils.h"
-#import "FirebaseAuth/Sources/Utilities/FIRAuthRecaptchaVerifier.h"
#import "FirebaseAuth/Tests/Unit/FIRApp+FIRAuthUnitTests.h"
#import "FirebaseAuth/Tests/Unit/OCMStubRecorder+FIRAuthUnitTests.h"
@@ -268,16 +267,6 @@
*/
static const NSTimeInterval kWaitInterval = .5;
-/** @var kFakeRecaptchaResponse
- @brief The fake recaptcha response.
- */
-static NSString *const kFakeRecaptchaResponse = @"RecaptchaResponse";
-
-/** @var kFakeRecaptchaVersion
- @brief The fake recaptcha version.
- */
-static NSString *const kFakeRecaptchaVersion = @"RecaptchaVersion";
-
#if TARGET_OS_IOS
/** @class FIRAuthAppDelegate
@brief Application delegate implementation to test the app delegate proxying
@@ -640,120 +629,6 @@ - (void)testSignInWithEmailLinkFailure {
OCMVerifyAll(_mockBackend);
}
-#if TARGET_OS_IOS && !TARGET_OS_MACCATALYST
-/** @fn testSignInWithEmailPasswordWithRecaptchaSuccess
- @brief Tests the flow of a successful @c signInWithEmail:password:completion: call.
- */
-- (void)testSignInWithEmailPasswordWithRecaptchaSuccess {
- id mockVerifier = OCMClassMock([FIRAuthRecaptchaVerifier class]);
- OCMStub([mockVerifier sharedRecaptchaVerifier:[FIRAuth auth]]).andReturn(mockVerifier);
- OCMExpect([mockVerifier enablementStatusForProvider:FIRAuthRecaptchaProviderPassword])
- .andReturn(YES);
- FIRVerifyPasswordRequest *constRequestWithRecaptchaToken =
- [[FIRVerifyPasswordRequest alloc] initWithEmail:kEmail
- password:kFakePassword
- requestConfiguration:[FIRAuth auth].requestConfiguration];
- [constRequestWithRecaptchaToken injectRecaptchaFields:kFakeRecaptchaResponse
- recaptchaVersion:kFakeRecaptchaVersion];
- OCMStub([mockVerifier
- injectRecaptchaFields:[OCMArg any]
- provider:FIRAuthRecaptchaProviderPassword
- action:FIRAuthRecaptchaActionSignInWithPassword
- completion:([OCMArg invokeBlockWithArgs:constRequestWithRecaptchaToken, nil])]);
- OCMExpect([_mockBackend verifyPassword:[OCMArg any] callback:[OCMArg any]])
- .andCallBlock2(^(FIRVerifyPasswordRequest *_Nullable request,
- FIRVerifyPasswordResponseCallback callback) {
- XCTAssertEqualObjects(request.APIKey, kAPIKey);
- XCTAssertEqualObjects(request.email, kEmail);
- XCTAssertEqualObjects(request.password, kFakePassword);
- XCTAssertTrue(request.returnSecureToken);
- dispatch_async(FIRAuthGlobalWorkQueue(), ^() {
- id mockVerifyPasswordResponse = OCMClassMock([FIRVerifyPasswordResponse class]);
- [self stubTokensWithMockResponse:mockVerifyPasswordResponse];
- callback(mockVerifyPasswordResponse, nil);
- });
- });
- [self expectGetAccountInfo];
- XCTestExpectation *expectation = [self expectationWithDescription:@"callback"];
- [[FIRAuth auth] signOut:NULL];
- [[FIRAuth auth] signInWithEmail:kEmail
- password:kFakePassword
- completion:^(FIRAuthDataResult *_Nullable result, NSError *_Nullable error) {
- XCTAssertTrue([NSThread isMainThread]);
- [self assertUser:result.user];
- XCTAssertNil(error);
- [expectation fulfill];
- }];
- [self waitForExpectationsWithTimeout:kExpectationTimeout handler:nil];
- [self assertUser:[FIRAuth auth].currentUser];
-}
-
-/** @fn testSignInWithEmailPasswordWithRecaptchaFallbackSuccess
- @brief Tests the flow of a successful @c signInWithEmail:password:completion: call.
- */
-- (void)testSignInWithEmailPasswordWithRecaptchaFallbackSuccess {
- id mockVerifier = OCMClassMock([FIRAuthRecaptchaVerifier class]);
- OCMStub([mockVerifier sharedRecaptchaVerifier:[FIRAuth auth]]).andReturn(mockVerifier);
- OCMExpect([mockVerifier enablementStatusForProvider:FIRAuthRecaptchaProviderPassword])
- .andReturn(YES);
- FIRVerifyPasswordRequest *constRequestWithRecaptchaToken =
- [[FIRVerifyPasswordRequest alloc] initWithEmail:kEmail
- password:kFakePassword
- requestConfiguration:[FIRAuth auth].requestConfiguration];
- [constRequestWithRecaptchaToken injectRecaptchaFields:kFakeRecaptchaResponse
- recaptchaVersion:kFakeRecaptchaVersion];
- OCMStub([mockVerifier
- injectRecaptchaFields:[OCMArg any]
- provider:FIRAuthRecaptchaProviderPassword
- action:FIRAuthRecaptchaActionSignInWithPassword
- completion:([OCMArg invokeBlockWithArgs:constRequestWithRecaptchaToken, nil])]);
- OCMExpect([_mockBackend verifyPassword:[OCMArg any] callback:[OCMArg any]])
- .andCallBlock2(^(FIRVerifyPasswordRequest *_Nullable request,
- FIRVerifyPasswordResponseCallback callback) {
- XCTAssertEqualObjects(request.APIKey, kAPIKey);
- XCTAssertEqualObjects(request.email, kEmail);
- XCTAssertEqualObjects(request.password, kFakePassword);
- XCTAssertTrue(request.returnSecureToken);
- dispatch_async(FIRAuthGlobalWorkQueue(), ^() {
- id mockVerifyPasswordResponse = OCMClassMock([FIRVerifyPasswordResponse class]);
- [self stubTokensWithMockResponse:mockVerifyPasswordResponse];
- callback(mockVerifyPasswordResponse, nil);
- });
- });
- OCMExpect([_mockBackend verifyPassword:[OCMArg any] callback:[OCMArg any]])
- .andCallBlock2(^(FIRVerifyPasswordRequest *_Nullable request,
- FIRVerifyPasswordResponseCallback callback) {
- XCTAssertEqualObjects(request.APIKey, kAPIKey);
- XCTAssertEqualObjects(request.email, kEmail);
- XCTAssertEqualObjects(request.password, kFakePassword);
- XCTAssertTrue(request.returnSecureToken);
- NSError *underlyingError =
- [[NSError alloc] initWithDomain:FIRAuthErrorDomain
- code:FIRAuthErrorCodeInternalError
- userInfo:@{NSUnderlyingErrorKey : @"MISSING_RECAPTCHA_TOKEN"}];
- NSError *error = [[NSError alloc] initWithDomain:FIRAuthErrorDomain
- code:FIRAuthErrorCodeInternalError
- userInfo:@{NSUnderlyingErrorKey : underlyingError}];
- dispatch_async(FIRAuthGlobalWorkQueue(), ^() {
- callback(nil, error);
- });
- });
- [self expectGetAccountInfo];
- XCTestExpectation *expectation = [self expectationWithDescription:@"callback"];
- [[FIRAuth auth] signOut:NULL];
- [[FIRAuth auth] signInWithEmail:kEmail
- password:kFakePassword
- completion:^(FIRAuthDataResult *_Nullable result, NSError *_Nullable error) {
- XCTAssertTrue([NSThread isMainThread]);
- [self assertUser:result.user];
- XCTAssertNil(error);
- [expectation fulfill];
- }];
- [self waitForExpectationsWithTimeout:kExpectationTimeout handler:nil];
- [self assertUser:[FIRAuth auth].currentUser];
-}
-#endif
-
/** @fn testSignInWithEmailPasswordSuccess
@brief Tests the flow of a successful @c signInWithEmail:password:completion: call.
*/
@@ -1802,129 +1677,6 @@ - (void)testSignInAndRetrieveDataWithCustomTokenFailure {
OCMVerifyAll(_mockBackend);
}
-#if TARGET_OS_IOS && !TARGET_OS_MACCATALYST
-/** @fn testCreateUserWithEmailPasswordWithRecaptchaVerificationSuccess
- @brief Tests the flow of a successful @c createUserWithEmail:password:completion: call.
- */
-- (void)testCreateUserWithEmailPasswordWithRecaptchaVerificationSuccess {
- id mockVerifier = OCMClassMock([FIRAuthRecaptchaVerifier class]);
- OCMStub([mockVerifier sharedRecaptchaVerifier:[FIRAuth auth]]).andReturn(mockVerifier);
- OCMExpect([mockVerifier enablementStatusForProvider:FIRAuthRecaptchaProviderPassword])
- .andReturn(YES);
- FIRSignUpNewUserRequest *constRequestWithRecaptchaToken =
- [[FIRSignUpNewUserRequest alloc] initWithEmail:kEmail
- password:kFakePassword
- displayName:kDisplayName
- requestConfiguration:[FIRAuth auth].requestConfiguration];
- [constRequestWithRecaptchaToken injectRecaptchaFields:kFakeRecaptchaResponse
- recaptchaVersion:kFakeRecaptchaVersion];
- OCMStub([mockVerifier
- injectRecaptchaFields:[OCMArg any]
- provider:FIRAuthRecaptchaProviderPassword
- action:FIRAuthRecaptchaActionSignUpPassword
- completion:([OCMArg invokeBlockWithArgs:constRequestWithRecaptchaToken, nil])]);
- OCMExpect([_mockBackend signUpNewUser:[OCMArg any] callback:[OCMArg any]])
- .andCallBlock2(
- ^(FIRSignUpNewUserRequest *_Nullable request, FIRSignupNewUserCallback callback) {
- XCTAssertEqualObjects(request.APIKey, kAPIKey);
- XCTAssertEqualObjects(request.email, kEmail);
- XCTAssertEqualObjects(request.password, kFakePassword);
- XCTAssertTrue(request.returnSecureToken);
- dispatch_async(FIRAuthGlobalWorkQueue(), ^() {
- id mockSignUpNewUserResponse = OCMClassMock([FIRSignUpNewUserResponse class]);
- [self stubTokensWithMockResponse:mockSignUpNewUserResponse];
- callback(mockSignUpNewUserResponse, nil);
- });
- });
- [self expectGetAccountInfo];
- XCTestExpectation *expectation = [self expectationWithDescription:@"callback"];
- [[FIRAuth auth] signOut:NULL];
- [[FIRAuth auth]
- createUserWithEmail:kEmail
- password:kFakePassword
- completion:^(FIRAuthDataResult *_Nullable result, NSError *_Nullable error) {
- XCTAssertTrue([NSThread isMainThread]);
- [self assertUser:result.user];
- XCTAssertNil(error);
- [expectation fulfill];
- }];
- [self waitForExpectationsWithTimeout:kExpectationTimeout handler:nil];
- [self assertUser:[FIRAuth auth].currentUser];
-}
-
-/** @fn testCreateUserWithEmailPasswordWithRecaptchaVerificationFallbackSuccess
- @brief Tests the flow of a successful @c createUserWithEmail:password:completion: call.
- */
-- (void)testCreateUserWithEmailPasswordWithRecaptchaVerificationFallbackSuccess {
- id mockVerifier = OCMClassMock([FIRAuthRecaptchaVerifier class]);
- OCMStub([mockVerifier sharedRecaptchaVerifier:[FIRAuth auth]]).andReturn(mockVerifier);
- OCMExpect([mockVerifier enablementStatusForProvider:FIRAuthRecaptchaProviderPassword])
- .andReturn(YES);
- FIRSignUpNewUserRequest *constRequest =
- [[FIRSignUpNewUserRequest alloc] initWithEmail:kEmail
- password:kFakePassword
- displayName:kDisplayName
- requestConfiguration:[FIRAuth auth].requestConfiguration];
- FIRSignUpNewUserRequest *constRequestWithRecaptchaToken =
- [[FIRSignUpNewUserRequest alloc] initWithEmail:kEmail
- password:kFakePassword
- displayName:kDisplayName
- requestConfiguration:[FIRAuth auth].requestConfiguration];
- [constRequestWithRecaptchaToken injectRecaptchaFields:kFakeRecaptchaResponse
- recaptchaVersion:kFakeRecaptchaVersion];
- OCMStub([mockVerifier
- injectRecaptchaFields:[OCMArg any]
- provider:FIRAuthRecaptchaProviderPassword
- action:FIRAuthRecaptchaActionSignUpPassword
- completion:([OCMArg invokeBlockWithArgs:constRequestWithRecaptchaToken, nil])]);
- OCMExpect([_mockBackend signUpNewUser:constRequest callback:[OCMArg any]])
- .andCallBlock2(^(FIRSignUpNewUserRequest *_Nullable request,
- FIRSignupNewUserCallback callback) {
- XCTAssertEqualObjects(request.APIKey, kAPIKey);
- XCTAssertEqualObjects(request.email, kEmail);
- XCTAssertEqualObjects(request.password, kFakePassword);
- XCTAssertTrue(request.returnSecureToken);
- NSError *underlyingError =
- [[NSError alloc] initWithDomain:FIRAuthErrorDomain
- code:FIRAuthErrorCodeInternalError
- userInfo:@{NSUnderlyingErrorKey : @"MISSING_RECAPTCHA_TOKEN"}];
- NSError *error = [[NSError alloc] initWithDomain:FIRAuthErrorDomain
- code:FIRAuthErrorCodeInternalError
- userInfo:@{NSUnderlyingErrorKey : underlyingError}];
- dispatch_async(FIRAuthGlobalWorkQueue(), ^() {
- callback(nil, error);
- });
- });
- OCMExpect([_mockBackend signUpNewUser:constRequestWithRecaptchaToken callback:[OCMArg any]])
- .andCallBlock2(
- ^(FIRSignUpNewUserRequest *_Nullable request, FIRSignupNewUserCallback callback) {
- XCTAssertEqualObjects(request.APIKey, kAPIKey);
- XCTAssertEqualObjects(request.email, kEmail);
- XCTAssertEqualObjects(request.password, kFakePassword);
- XCTAssertTrue(request.returnSecureToken);
- dispatch_async(FIRAuthGlobalWorkQueue(), ^() {
- id mockSignUpNewUserResponse = OCMClassMock([FIRSignUpNewUserResponse class]);
- [self stubTokensWithMockResponse:mockSignUpNewUserResponse];
- callback(mockSignUpNewUserResponse, nil);
- });
- });
- [self expectGetAccountInfo];
- XCTestExpectation *expectation = [self expectationWithDescription:@"callback"];
- [[FIRAuth auth] signOut:NULL];
- [[FIRAuth auth]
- createUserWithEmail:kEmail
- password:kFakePassword
- completion:^(FIRAuthDataResult *_Nullable result, NSError *_Nullable error) {
- XCTAssertTrue([NSThread isMainThread]);
- [self assertUser:result.user];
- XCTAssertNil(error);
- [expectation fulfill];
- }];
- [self waitForExpectationsWithTimeout:kExpectationTimeout handler:nil];
- [self assertUser:[FIRAuth auth].currentUser];
-}
-#endif
-
/** @fn testCreateUserWithEmailPasswordSuccess
@brief Tests the flow of a successful @c createUserWithEmail:password:completion: call.
*/
@@ -2084,102 +1836,6 @@ - (void)testCreateUserEmptyEmailFailure {
[self waitForExpectationsWithTimeout:kExpectationTimeout handler:nil];
}
-#if TARGET_OS_IOS && !TARGET_OS_MACCATALYST
-/** @fn testSendPasswordResetEmailWithRecaptchaSuccess
- @brief Tests the flow of a successful @c sendPasswordResetWithEmail:completion: call.
- */
-- (void)testSendPasswordResetEmailWithRecaptchaSuccess {
- id mockVerifier = OCMClassMock([FIRAuthRecaptchaVerifier class]);
- OCMStub([mockVerifier sharedRecaptchaVerifier:[FIRAuth auth]]).andReturn(mockVerifier);
- OCMExpect([mockVerifier enablementStatusForProvider:FIRAuthRecaptchaProviderPassword])
- .andReturn(YES);
- FIRGetOOBConfirmationCodeRequest *constRequestWithRecaptchaToken =
- [FIRGetOOBConfirmationCodeRequest
- passwordResetRequestWithEmail:kEmail
- actionCodeSettings:nil
- requestConfiguration:[FIRAuth auth].requestConfiguration];
- [constRequestWithRecaptchaToken injectRecaptchaFields:kFakeRecaptchaResponse
- recaptchaVersion:kFakeRecaptchaVersion];
- OCMStub([mockVerifier
- injectRecaptchaFields:[OCMArg any]
- provider:FIRAuthRecaptchaProviderPassword
- action:FIRAuthRecaptchaActionGetOobCode
- completion:([OCMArg invokeBlockWithArgs:constRequestWithRecaptchaToken, nil])]);
- OCMExpect([_mockBackend getOOBConfirmationCode:[OCMArg any] callback:[OCMArg any]])
- .andCallBlock2(^(FIRGetOOBConfirmationCodeRequest *_Nullable request,
- FIRGetOOBConfirmationCodeResponseCallback callback) {
- XCTAssertEqualObjects(request.APIKey, kAPIKey);
- XCTAssertEqualObjects(request.email, kEmail);
- dispatch_async(FIRAuthGlobalWorkQueue(), ^() {
- callback([[FIRGetOOBConfirmationCodeResponse alloc] init], nil);
- });
- });
- XCTestExpectation *expectation = [self expectationWithDescription:@"callback"];
- [[FIRAuth auth] sendPasswordResetWithEmail:kEmail
- completion:^(NSError *_Nullable error) {
- XCTAssertTrue([NSThread isMainThread]);
- XCTAssertNil(error);
- [expectation fulfill];
- }];
- [self waitForExpectationsWithTimeout:kExpectationTimeout handler:nil];
-}
-
-/** @fn testSendPasswordResetEmailWithRecaptchaFallbackSuccess
- @brief Tests the flow of a successful @c sendPasswordResetWithEmail:completion: call.
- */
-- (void)testSendPasswordResetEmailWithRecaptchaFallbackSuccess {
- id mockVerifier = OCMClassMock([FIRAuthRecaptchaVerifier class]);
- OCMStub([mockVerifier sharedRecaptchaVerifier:[FIRAuth auth]]).andReturn(mockVerifier);
- OCMExpect([mockVerifier enablementStatusForProvider:FIRAuthRecaptchaProviderPassword])
- .andReturn(YES);
- FIRGetOOBConfirmationCodeRequest *constRequestWithRecaptchaToken =
- [FIRGetOOBConfirmationCodeRequest
- passwordResetRequestWithEmail:kEmail
- actionCodeSettings:nil
- requestConfiguration:[FIRAuth auth].requestConfiguration];
- [constRequestWithRecaptchaToken injectRecaptchaFields:kFakeRecaptchaResponse
- recaptchaVersion:kFakeRecaptchaVersion];
- OCMStub([mockVerifier
- injectRecaptchaFields:[OCMArg any]
- provider:FIRAuthRecaptchaProviderPassword
- action:FIRAuthRecaptchaActionGetOobCode
- completion:([OCMArg invokeBlockWithArgs:constRequestWithRecaptchaToken, nil])]);
- OCMExpect([_mockBackend getOOBConfirmationCode:[OCMArg any] callback:[OCMArg any]])
- .andCallBlock2(^(FIRGetOOBConfirmationCodeRequest *_Nullable request,
- FIRGetOOBConfirmationCodeResponseCallback callback) {
- XCTAssertEqualObjects(request.APIKey, kAPIKey);
- XCTAssertEqualObjects(request.email, kEmail);
- dispatch_async(FIRAuthGlobalWorkQueue(), ^() {
- callback([[FIRGetOOBConfirmationCodeResponse alloc] init], nil);
- });
- });
- OCMExpect([_mockBackend getOOBConfirmationCode:[OCMArg any] callback:[OCMArg any]])
- .andCallBlock2(^(FIRGetOOBConfirmationCodeRequest *_Nullable request,
- FIRGetOOBConfirmationCodeResponseCallback callback) {
- XCTAssertEqualObjects(request.APIKey, kAPIKey);
- XCTAssertEqualObjects(request.email, kEmail);
- NSError *underlyingError =
- [[NSError alloc] initWithDomain:FIRAuthErrorDomain
- code:FIRAuthErrorCodeInternalError
- userInfo:@{NSUnderlyingErrorKey : @"MISSING_RECAPTCHA_TOKEN"}];
- NSError *error = [[NSError alloc] initWithDomain:FIRAuthErrorDomain
- code:FIRAuthErrorCodeInternalError
- userInfo:@{NSUnderlyingErrorKey : underlyingError}];
- dispatch_async(FIRAuthGlobalWorkQueue(), ^() {
- callback(nil, error);
- });
- });
- XCTestExpectation *expectation = [self expectationWithDescription:@"callback"];
- [[FIRAuth auth] sendPasswordResetWithEmail:kEmail
- completion:^(NSError *_Nullable error) {
- XCTAssertTrue([NSThread isMainThread]);
- XCTAssertNil(error);
- [expectation fulfill];
- }];
- [self waitForExpectationsWithTimeout:kExpectationTimeout handler:nil];
-}
-#endif
-
/** @fn testSendPasswordResetEmailSuccess
@brief Tests the flow of a successful @c sendPasswordResetWithEmail:completion: call.
*/
@@ -2222,112 +1878,6 @@ - (void)testSendPasswordResetEmailFailure {
OCMVerifyAll(_mockBackend);
}
-#if TARGET_OS_IOS && !TARGET_OS_MACCATALYST
-/** @fn testSendSignInLinkToEmailWithRecaptchaSuccess
- @brief Tests the flow of a successful @c sendSignInLinkToEmail:actionCodeSettings:completion:
- call.
- */
-- (void)testSendSignInLinkToEmailWithRecaptchaSuccess {
- id mockVerifier = OCMClassMock([FIRAuthRecaptchaVerifier class]);
- OCMStub([mockVerifier sharedRecaptchaVerifier:[FIRAuth auth]]).andReturn(mockVerifier);
- OCMExpect([mockVerifier enablementStatusForProvider:FIRAuthRecaptchaProviderPassword])
- .andReturn(YES);
- FIRGetOOBConfirmationCodeRequest *constRequestWithRecaptchaToken =
- [FIRGetOOBConfirmationCodeRequest
- signInWithEmailLinkRequest:kEmail
- actionCodeSettings:[self fakeActionCodeSettings]
- requestConfiguration:[FIRAuth auth].requestConfiguration];
- [constRequestWithRecaptchaToken injectRecaptchaFields:kFakeRecaptchaResponse
- recaptchaVersion:kFakeRecaptchaVersion];
- OCMStub([mockVerifier
- injectRecaptchaFields:[OCMArg any]
- provider:FIRAuthRecaptchaProviderPassword
- action:FIRAuthRecaptchaActionGetOobCode
- completion:([OCMArg invokeBlockWithArgs:constRequestWithRecaptchaToken, nil])]);
- OCMExpect([_mockBackend getOOBConfirmationCode:[OCMArg any] callback:[OCMArg any]])
- .andCallBlock2(^(FIRGetOOBConfirmationCodeRequest *_Nullable request,
- FIRGetOOBConfirmationCodeResponseCallback callback) {
- XCTAssertEqualObjects(request.APIKey, kAPIKey);
- XCTAssertEqualObjects(request.email, kEmail);
- XCTAssertEqualObjects(request.continueURL, kContinueURL);
- XCTAssertTrue(request.handleCodeInApp);
- dispatch_async(FIRAuthGlobalWorkQueue(), ^() {
- callback([[FIRGetOOBConfirmationCodeResponse alloc] init], nil);
- });
- });
- XCTestExpectation *expectation = [self expectationWithDescription:@"callback"];
- [[FIRAuth auth] sendSignInLinkToEmail:kEmail
- actionCodeSettings:[self fakeActionCodeSettings]
- completion:^(NSError *_Nullable error) {
- XCTAssertTrue([NSThread isMainThread]);
- XCTAssertNil(error);
- [expectation fulfill];
- }];
- [self waitForExpectationsWithTimeout:kExpectationTimeout handler:nil];
-}
-
-/** @fn testSendSignInLinkToEmailWithRecaptchaFallbackSuccess
- @brief Tests the flow of a successful @c sendSignInLinkToEmail:actionCodeSettings:completion:
- call.
- */
-- (void)testSendSignInLinkToEmailWithRecaptchaFallbackSuccess {
- id mockVerifier = OCMClassMock([FIRAuthRecaptchaVerifier class]);
- OCMStub([mockVerifier sharedRecaptchaVerifier:[FIRAuth auth]]).andReturn(mockVerifier);
- OCMExpect([mockVerifier enablementStatusForProvider:FIRAuthRecaptchaProviderPassword])
- .andReturn(YES);
- FIRGetOOBConfirmationCodeRequest *constRequestWithRecaptchaToken =
- [FIRGetOOBConfirmationCodeRequest
- signInWithEmailLinkRequest:kEmail
- actionCodeSettings:[self fakeActionCodeSettings]
- requestConfiguration:[FIRAuth auth].requestConfiguration];
- [constRequestWithRecaptchaToken injectRecaptchaFields:kFakeRecaptchaResponse
- recaptchaVersion:kFakeRecaptchaVersion];
- OCMStub([mockVerifier
- injectRecaptchaFields:[OCMArg any]
- provider:FIRAuthRecaptchaProviderPassword
- action:FIRAuthRecaptchaActionGetOobCode
- completion:([OCMArg invokeBlockWithArgs:constRequestWithRecaptchaToken, nil])]);
- OCMExpect([_mockBackend getOOBConfirmationCode:[OCMArg any] callback:[OCMArg any]])
- .andCallBlock2(^(FIRGetOOBConfirmationCodeRequest *_Nullable request,
- FIRGetOOBConfirmationCodeResponseCallback callback) {
- XCTAssertEqualObjects(request.APIKey, kAPIKey);
- XCTAssertEqualObjects(request.email, kEmail);
- XCTAssertEqualObjects(request.continueURL, kContinueURL);
- XCTAssertTrue(request.handleCodeInApp);
- dispatch_async(FIRAuthGlobalWorkQueue(), ^() {
- callback([[FIRGetOOBConfirmationCodeResponse alloc] init], nil);
- });
- });
- OCMExpect([_mockBackend getOOBConfirmationCode:[OCMArg any] callback:[OCMArg any]])
- .andCallBlock2(^(FIRGetOOBConfirmationCodeRequest *_Nullable request,
- FIRGetOOBConfirmationCodeResponseCallback callback) {
- XCTAssertEqualObjects(request.APIKey, kAPIKey);
- XCTAssertEqualObjects(request.email, kEmail);
- XCTAssertEqualObjects(request.continueURL, kContinueURL);
- XCTAssertTrue(request.handleCodeInApp);
- NSError *underlyingError =
- [[NSError alloc] initWithDomain:FIRAuthErrorDomain
- code:FIRAuthErrorCodeInternalError
- userInfo:@{NSUnderlyingErrorKey : @"MISSING_RECAPTCHA_TOKEN"}];
- NSError *error = [[NSError alloc] initWithDomain:FIRAuthErrorDomain
- code:FIRAuthErrorCodeInternalError
- userInfo:@{NSUnderlyingErrorKey : underlyingError}];
- dispatch_async(FIRAuthGlobalWorkQueue(), ^() {
- callback(nil, error);
- });
- });
- XCTestExpectation *expectation = [self expectationWithDescription:@"callback"];
- [[FIRAuth auth] sendSignInLinkToEmail:kEmail
- actionCodeSettings:[self fakeActionCodeSettings]
- completion:^(NSError *_Nullable error) {
- XCTAssertTrue([NSThread isMainThread]);
- XCTAssertNil(error);
- [expectation fulfill];
- }];
- [self waitForExpectationsWithTimeout:kExpectationTimeout handler:nil];
-}
-#endif
-
/** @fn testSendSignInLinkToEmailSuccess
@brief Tests the flow of a successful @c sendSignInLinkToEmail:actionCodeSettings:completion:
call.
diff --git a/FirebaseAuth/Tests/Unit/FIRFakeBackendRPCIssuer.m b/FirebaseAuth/Tests/Unit/FIRFakeBackendRPCIssuer.m
index a822edf1bf7..b976e3a2932 100644
--- a/FirebaseAuth/Tests/Unit/FIRFakeBackendRPCIssuer.m
+++ b/FirebaseAuth/Tests/Unit/FIRFakeBackendRPCIssuer.m
@@ -36,7 +36,7 @@ @implementation FIRFakeBackendRPCIssuer {
FIRAuthBackendRPCIssuerCompletionHandler _handler;
}
-- (void)asyncCallToURLWithRequestConfiguration:(FIRAuthRequestConfiguration *)requestConfiguration
+- (void)asyncPostToURLWithRequestConfiguration:(FIRAuthRequestConfiguration *)requestConfiguration
URL:(NSURL *)URL
body:(NSData *)body
contentType:(NSString *)contentType
diff --git a/FirebaseAuth/Tests/Unit/FIRGetOOBConfirmationCodeRequestTests.m b/FirebaseAuth/Tests/Unit/FIRGetOOBConfirmationCodeRequestTests.m
index 565077fa04f..e9386e15aff 100644
--- a/FirebaseAuth/Tests/Unit/FIRGetOOBConfirmationCodeRequestTests.m
+++ b/FirebaseAuth/Tests/Unit/FIRGetOOBConfirmationCodeRequestTests.m
@@ -142,36 +142,6 @@
*/
static NSString *const kDynamicLinkDomain = @"test.page.link";
-/** @var kCaptchaResponseKey
- @brief The key for the "captchaResponse" value in the request.
- */
-static NSString *const kCaptchaResponseKey = @"captchaResp";
-
-/** @var kTestCaptchaResponse
- @brief Fake captchaResponse for testing the request.
- */
-static NSString *const kTestCaptchaResponse = @"testCaptchaResponse";
-
-/** @var kClientTypeKey
- @brief The key for the "clientType" value in the request.
- */
-static NSString *const kClientTypeKey = @"clientType";
-
-/** @var kTestClientType
- @brief Fake clientType for testing the request.
- */
-static NSString *const kTestClientType = @"testClientType";
-
-/** @var kRecaptchaVersionKey
- @brief The key for the "recaptchaVersion" value in the request.
- */
-static NSString *const kRecaptchaVersionKey = @"recaptchaVersion";
-
-/** @var kTestRecaptchaVersion
- @brief Fake recaptchaVersion for testing the request.
- */
-static NSString *const kTestRecaptchaVersion = @"testRecaptchaVersion";
-
/** @class FIRGetOOBConfirmationCodeRequestTests
@brief Tests for @c FIRGetOOBConfirmationCodeRequest.
*/
@@ -319,92 +289,6 @@ - (void)testEmailVerificationRequest {
XCTAssertEqualObjects(_RPCIssuer.decodedRequest[kDynamicLinkDomainKey], kDynamicLinkDomain);
}
-/** @fn testPasswordResetRequestOptionalFields
- @brief Tests the encoding of a password reset request with optional fields.
- */
-- (void)testPasswordResetRequestOptionalFields {
- FIRGetOOBConfirmationCodeRequest *request =
- [FIRGetOOBConfirmationCodeRequest passwordResetRequestWithEmail:kTestEmail
- actionCodeSettings:[self fakeActionCodeSettings]
- requestConfiguration:_requestConfiguration];
-
- __block BOOL callbackInvoked;
- __block FIRGetOOBConfirmationCodeResponse *RPCResponse;
- __block NSError *RPCError;
- request.captchaResponse = kTestCaptchaResponse;
- request.clientType = kTestClientType;
- request.recaptchaVersion = kTestRecaptchaVersion;
- [FIRAuthBackend getOOBConfirmationCode:request
- callback:^(FIRGetOOBConfirmationCodeResponse *_Nullable response,
- NSError *_Nullable error) {
- callbackInvoked = YES;
- RPCResponse = response;
- RPCError = error;
- }];
-
- XCTAssertEqualObjects(_RPCIssuer.requestURL.absoluteString, kExpectedAPIURL);
- XCTAssertNotNil(_RPCIssuer.decodedRequest);
- XCTAssert([_RPCIssuer.decodedRequest isKindOfClass:[NSDictionary class]]);
- XCTAssertEqualObjects(_RPCIssuer.decodedRequest[kEmailKey], kTestEmail);
- XCTAssertEqualObjects(_RPCIssuer.decodedRequest[kRequestTypeKey], kPasswordResetRequestTypeValue);
- XCTAssertEqualObjects(_RPCIssuer.decodedRequest[kContinueURLKey], kContinueURL);
- XCTAssertEqualObjects(_RPCIssuer.decodedRequest[kIosBundleIDKey], kIosBundleID);
- XCTAssertEqualObjects(_RPCIssuer.decodedRequest[kAndroidPackageNameKey], kAndroidPackageName);
- XCTAssertEqualObjects(_RPCIssuer.decodedRequest[kAndroidMinimumVersionKey],
- kAndroidMinimumVersion);
- XCTAssertEqualObjects(_RPCIssuer.decodedRequest[kAndroidInstallAppKey],
- [NSNumber numberWithBool:YES]);
- XCTAssertEqualObjects(_RPCIssuer.decodedRequest[kCanHandleCodeInAppKey],
- [NSNumber numberWithBool:YES]);
- XCTAssertEqualObjects(_RPCIssuer.decodedRequest[kDynamicLinkDomainKey], kDynamicLinkDomain);
- XCTAssertEqualObjects(_RPCIssuer.decodedRequest[kCaptchaResponseKey], kTestCaptchaResponse);
- XCTAssertEqualObjects(_RPCIssuer.decodedRequest[kClientTypeKey], kTestClientType);
- XCTAssertEqualObjects(_RPCIssuer.decodedRequest[kRecaptchaVersionKey], kTestRecaptchaVersion);
-}
-
-/** @fn testSignInWithEmailLinkRequestOptionalFields
- @brief Tests the encoding of a email sign-in link request with optional fields.
- */
-- (void)testSignInWithEmailLinkRequestOptionalFields {
- FIRGetOOBConfirmationCodeRequest *request =
- [FIRGetOOBConfirmationCodeRequest signInWithEmailLinkRequest:kTestEmail
- actionCodeSettings:[self fakeActionCodeSettings]
- requestConfiguration:_requestConfiguration];
-
- __block BOOL callbackInvoked;
- __block FIRGetOOBConfirmationCodeResponse *RPCResponse;
- __block NSError *RPCError;
- request.captchaResponse = kTestCaptchaResponse;
- request.clientType = kTestClientType;
- request.recaptchaVersion = kTestRecaptchaVersion;
- [FIRAuthBackend getOOBConfirmationCode:request
- callback:^(FIRGetOOBConfirmationCodeResponse *_Nullable response,
- NSError *_Nullable error) {
- callbackInvoked = YES;
- RPCResponse = response;
- RPCError = error;
- }];
-
- XCTAssertEqualObjects(_RPCIssuer.requestURL.absoluteString, kExpectedAPIURL);
- XCTAssertNotNil(_RPCIssuer.decodedRequest);
- XCTAssert([_RPCIssuer.decodedRequest isKindOfClass:[NSDictionary class]]);
- XCTAssertEqualObjects(_RPCIssuer.decodedRequest[kEmailKey], kTestEmail);
- XCTAssertEqualObjects(_RPCIssuer.decodedRequest[kRequestTypeKey], kEmailLinkSignInTypeValue);
- XCTAssertEqualObjects(_RPCIssuer.decodedRequest[kContinueURLKey], kContinueURL);
- XCTAssertEqualObjects(_RPCIssuer.decodedRequest[kIosBundleIDKey], kIosBundleID);
- XCTAssertEqualObjects(_RPCIssuer.decodedRequest[kAndroidPackageNameKey], kAndroidPackageName);
- XCTAssertEqualObjects(_RPCIssuer.decodedRequest[kAndroidMinimumVersionKey],
- kAndroidMinimumVersion);
- XCTAssertEqualObjects(_RPCIssuer.decodedRequest[kAndroidInstallAppKey],
- [NSNumber numberWithBool:YES]);
- XCTAssertEqualObjects(_RPCIssuer.decodedRequest[kCanHandleCodeInAppKey],
- [NSNumber numberWithBool:YES]);
- XCTAssertEqualObjects(_RPCIssuer.decodedRequest[kDynamicLinkDomainKey], kDynamicLinkDomain);
- XCTAssertEqualObjects(_RPCIssuer.decodedRequest[kCaptchaResponseKey], kTestCaptchaResponse);
- XCTAssertEqualObjects(_RPCIssuer.decodedRequest[kClientTypeKey], kTestClientType);
- XCTAssertEqualObjects(_RPCIssuer.decodedRequest[kRecaptchaVersionKey], kTestRecaptchaVersion);
-}
-
#pragma mark - Helpers
/** @fn fakeActionCodeSettings
diff --git a/FirebaseAuth/Tests/Unit/FIRGetRecaptchaConfigRequestTests.m b/FirebaseAuth/Tests/Unit/FIRGetRecaptchaConfigRequestTests.m
deleted file mode 100644
index a1f6a914794..00000000000
--- a/FirebaseAuth/Tests/Unit/FIRGetRecaptchaConfigRequestTests.m
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Copyright 2022 Google LLC
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#import
-
-#import "FirebaseAuth/Sources/Backend/FIRAuthBackend.h"
-#import "FirebaseAuth/Sources/Backend/RPC/FIRGetRecaptchaConfigRequest.h"
-#import "FirebaseAuth/Sources/Backend/RPC/FIRGetRecaptchaConfigResponse.h"
-#import "FirebaseAuth/Tests/Unit/FIRFakeBackendRPCIssuer.h"
-
-/** @var kGetRecaptchaConfigEndPoint
- @brief The "getRecaptchaConfig" endpoint.
- */
-static NSString *const kGetRecaptchaConfigEndPoint = @"recaptchaConfig";
-
-/** @var kTestAPIKey
- @brief Fake API key used for testing.
- */
-static NSString *const kTestAPIKey = @"APIKey";
-
-/** @var kTestFirebaseAppID
- @brief Fake Firebase app ID used for testing.
- */
-static NSString *const kTestFirebaseAppID = @"appID";
-
-/** @var kAPIURLFormat
- @brief URL format for server API calls.
- */
-static NSString *const kAPIURLFormat = @"https://identitytoolkit.googleapis.com/v2/%@?key=%@";
-
-/** @var gAPIHost
- @brief Host for server API calls.
- */
-static NSString *gAPIHost = @"www.googleapis.com";
-
-@interface FIRGetRecaptchaConfigRequestTests : XCTestCase
-@end
-
-@implementation FIRGetRecaptchaConfigRequestTests {
- /** @var _RPCIssuer
- @brief This backend RPC issuer is used to fake network responses for each test in the suite.
- In the @c setUp method we initialize this and set @c FIRAuthBackend's RPC issuer to it.
- */
- FIRFakeBackendRPCIssuer *_RPCIssuer;
-}
-
-- (void)setUp {
- [super setUp];
- FIRFakeBackendRPCIssuer *RPCIssuer = [[FIRFakeBackendRPCIssuer alloc] init];
- [FIRAuthBackend setDefaultBackendImplementationWithRPCIssuer:RPCIssuer];
- _RPCIssuer = RPCIssuer;
-}
-
-- (void)tearDown {
- _RPCIssuer = nil;
- [FIRAuthBackend setDefaultBackendImplementationWithRPCIssuer:nil];
- [super tearDown];
-}
-
-/** @fn testGetRecaptchaConfigRequest
- @brief Tests get Recaptcha config request.
- */
-- (void)testGetRecaptchaConfigRequest {
- FIRAuthRequestConfiguration *requestConfiguration =
- [[FIRAuthRequestConfiguration alloc] initWithAPIKey:kTestAPIKey appID:kTestFirebaseAppID];
- FIRGetRecaptchaConfigRequest *request =
- [[FIRGetRecaptchaConfigRequest alloc] initWithRequestConfiguration:requestConfiguration];
-
- [FIRAuthBackend getRecaptchaConfig:request
- callback:^(FIRGetRecaptchaConfigResponse *_Nullable response,
- NSError *_Nullable error){
-
- }];
- XCTAssertFalse([request containsPostBody]);
- // Confirm that the quest has no decoded body as it is get request.
- XCTAssertNil(_RPCIssuer.decodedRequest);
- NSMutableString *URLString =
- [NSMutableString stringWithFormat:kAPIURLFormat, kGetRecaptchaConfigEndPoint, kTestAPIKey];
- [URLString appendFormat:@"&%@=%@&%@=%@", @"clientType", @"CLIENT_TYPE_IOS", @"version",
- @"RECAPTCHA_ENTERPRISE"];
- XCTAssertEqualObjects(URLString, [request requestURL].absoluteString);
-}
-
-@end
diff --git a/FirebaseAuth/Tests/Unit/FIRGetRecaptchaConfigResponseTests.m b/FirebaseAuth/Tests/Unit/FIRGetRecaptchaConfigResponseTests.m
deleted file mode 100644
index 38fc47b1685..00000000000
--- a/FirebaseAuth/Tests/Unit/FIRGetRecaptchaConfigResponseTests.m
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Copyright 2022 Google LLC
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#import
-
-#import "FirebaseAuth/Sources/Public/FirebaseAuth/FIRAuthErrors.h"
-
-#import "FirebaseAuth/Sources/Backend/FIRAuthBackend.h"
-#import "FirebaseAuth/Sources/Backend/RPC/FIRGetRecaptchaConfigRequest.h"
-#import "FirebaseAuth/Sources/Backend/RPC/FIRGetRecaptchaConfigResponse.h"
-#import "FirebaseAuth/Sources/Utilities/FIRAuthInternalErrors.h"
-#import "FirebaseAuth/Tests/Unit/FIRFakeBackendRPCIssuer.h"
-
-/** @var kTestAPIKey
- @brief Fake API key used for testing.
- */
-static NSString *const kTestAPIKey = @"APIKey";
-
-/** @var kTestFirebaseAppID
- @brief Fake Firebase app ID used for testing.
- */
-static NSString *const kTestFirebaseAppID = @"appID";
-
-/** @var kTestRecaptchaID
- @brief Fake Recaptcha ID used for testing.
- */
-static NSString *const kTestRecaptchaKey = @"projects/123/keys/456";
-
-@interface FIRGetRecaptchaConfigResponseTests : XCTestCase
-@end
-
-@implementation FIRGetRecaptchaConfigResponseTests {
- /** @var _RPCIssuer
- @brief This backend RPC issuer is used to fake network responses for each test in the suite.
- In the @c setUp method we initialize this and set @c FIRAuthBackend's RPC issuer to it.
- */
- FIRFakeBackendRPCIssuer *_RPCIssuer;
-}
-
-- (void)setUp {
- [super setUp];
- FIRFakeBackendRPCIssuer *RPCIssuer = [[FIRFakeBackendRPCIssuer alloc] init];
- [FIRAuthBackend setDefaultBackendImplementationWithRPCIssuer:RPCIssuer];
- _RPCIssuer = RPCIssuer;
-}
-
-- (void)tearDown {
- _RPCIssuer = nil;
- [FIRAuthBackend setDefaultBackendImplementationWithRPCIssuer:nil];
- [super tearDown];
-}
-
-/** @fn testSuccessFulGetRecaptchaConfigRequest
- @brief This test simulates a successful @c getRecaptchaConfig Flow.
- */
-- (void)testSuccessFulGetRecaptchaConfigRequest {
- FIRAuthRequestConfiguration *requestConfiguration =
- [[FIRAuthRequestConfiguration alloc] initWithAPIKey:kTestAPIKey appID:kTestFirebaseAppID];
- FIRGetRecaptchaConfigRequest *request =
- [[FIRGetRecaptchaConfigRequest alloc] initWithRequestConfiguration:requestConfiguration];
-
- __block BOOL callbackInvoked;
- __block FIRGetRecaptchaConfigResponse *RPCResponse;
- __block NSError *RPCError;
- [FIRAuthBackend getRecaptchaConfig:request
- callback:^(FIRGetRecaptchaConfigResponse *_Nullable response,
- NSError *_Nullable error) {
- callbackInvoked = YES;
- RPCResponse = response;
- RPCError = error;
- }];
-
- [_RPCIssuer respondWithJSON:@{
- @"recaptchaKey" : kTestRecaptchaKey,
- }];
- XCTAssert(callbackInvoked);
- XCTAssertNil(RPCError);
- XCTAssertEqualObjects(kTestRecaptchaKey, RPCResponse.recaptchaKey);
-}
-
-@end
diff --git a/FirebaseAuth/Tests/Unit/FIRIdentityToolkitRequestTests.m b/FirebaseAuth/Tests/Unit/FIRIdentityToolkitRequestTests.m
index 059956df6f9..9a789a29338 100644
--- a/FirebaseAuth/Tests/Unit/FIRIdentityToolkitRequestTests.m
+++ b/FirebaseAuth/Tests/Unit/FIRIdentityToolkitRequestTests.m
@@ -73,8 +73,9 @@ - (void)testInitWithEndpointUseStagingExpectedRequestURL {
[[FIRAuthRequestConfiguration alloc] initWithAPIKey:kAPIKey appID:kFirebaseAppID];
FIRIdentityToolkitRequest *request =
[[FIRIdentityToolkitRequest alloc] initWithEndpoint:kEndpoint
- requestConfiguration:requestConfiguration];
- request.useStaging = YES;
+ requestConfiguration:requestConfiguration
+ useIdentityPlatform:NO
+ useStaging:YES];
NSString *expectedURL = [NSString
stringWithFormat:
@"https://staging-www.sandbox.googleapis.com/identitytoolkit/v3/relyingparty/%@?key=%@",
@@ -92,8 +93,9 @@ - (void)testInitWithEndpointUseIdentityPlatformExpectedRequestURL {
[[FIRAuthRequestConfiguration alloc] initWithAPIKey:kAPIKey appID:kFirebaseAppID];
FIRIdentityToolkitRequest *request =
[[FIRIdentityToolkitRequest alloc] initWithEndpoint:kEndpoint
- requestConfiguration:requestConfiguration];
- request.useIdentityPlatform = YES;
+ requestConfiguration:requestConfiguration
+ useIdentityPlatform:YES
+ useStaging:NO];
NSString *expectedURL = [NSString
stringWithFormat:@"https://identitytoolkit.googleapis.com/v2/%@?key=%@", kEndpoint, kAPIKey];
@@ -109,9 +111,9 @@ - (void)testInitWithEndpointUseIdentityPlatformUseStagingExpectedRequestURL {
[[FIRAuthRequestConfiguration alloc] initWithAPIKey:kAPIKey appID:kFirebaseAppID];
FIRIdentityToolkitRequest *request =
[[FIRIdentityToolkitRequest alloc] initWithEndpoint:kEndpoint
- requestConfiguration:requestConfiguration];
- request.useIdentityPlatform = YES;
- request.useStaging = YES;
+ requestConfiguration:requestConfiguration
+ useIdentityPlatform:YES
+ useStaging:YES];
NSString *expectedURL = [NSString
stringWithFormat:@"https://staging-identitytoolkit.sandbox.googleapis.com/v2/%@?key=%@",
kEndpoint, kAPIKey];
@@ -147,8 +149,9 @@ - (void)testInitWithEndpointUseIdentityPlatformUseEmulatorExpectedRequestURL {
requestConfiguration.emulatorHostAndPort = kEmulatorHostAndPort;
FIRIdentityToolkitRequest *request =
[[FIRIdentityToolkitRequest alloc] initWithEndpoint:kEndpoint
- requestConfiguration:requestConfiguration];
- request.useIdentityPlatform = YES;
+ requestConfiguration:requestConfiguration
+ useIdentityPlatform:YES
+ useStaging:NO];
NSString *expectedURL =
[NSString stringWithFormat:@"http://%@/identitytoolkit.googleapis.com/v2/%@?key=%@",
kEmulatorHostAndPort, kEndpoint, kAPIKey];
@@ -170,8 +173,9 @@ - (void)testExpectedTenantIDWithNonDefaultFIRApp {
requestConfiguration.emulatorHostAndPort = kEmulatorHostAndPort;
FIRIdentityToolkitRequest *request =
[[FIRIdentityToolkitRequest alloc] initWithEndpoint:kEndpoint
- requestConfiguration:requestConfiguration];
- request.useIdentityPlatform = YES;
+ requestConfiguration:requestConfiguration
+ useIdentityPlatform:YES
+ useStaging:NO];
XCTAssertEqualObjects(@"tenant-id", request.tenantID);
}
diff --git a/FirebaseAuth/Tests/Unit/FIRSignUpNewUserRequestTests.m b/FirebaseAuth/Tests/Unit/FIRSignUpNewUserRequestTests.m
index 5016e921068..0d88e731b55 100644
--- a/FirebaseAuth/Tests/Unit/FIRSignUpNewUserRequestTests.m
+++ b/FirebaseAuth/Tests/Unit/FIRSignUpNewUserRequestTests.m
@@ -70,36 +70,6 @@
*/
static NSString *const kTestPassword = @"Password";
-/** @var kCaptchaResponseKey
- @brief The key for the "captchaResponse" value in the request.
- */
-static NSString *const kCaptchaResponseKey = @"captchaResponse";
-
-/** @var kTestCaptchaResponse
- @brief Fake captchaResponse for testing the request.
- */
-static NSString *const kTestCaptchaResponse = @"testCaptchaResponse";
-
-/** @var kClientTypeKey
- @brief The key for the "clientType" value in the request.
- */
-static NSString *const kClientTypeKey = @"clientType";
-
-/** @var kTestClientType
- @brief Fake clientType for testing the request.
- */
-static NSString *const kTestClientType = @"testClientType";
-
-/** @var kRecaptchaVersionKey
- @brief The key for the "recaptchaVersion" value in the request.
- */
-static NSString *const kRecaptchaVersionKey = @"recaptchaVersion";
-
-/** @var kTestRecaptchaVersion
- @brief Fake recaptchaVersion for testing the request.
- */
-static NSString *const kTestRecaptchaVersion = @"testRecaptchaVersion";
-
/** @var kReturnSecureTokenKey
@brief The key for the "returnSecureToken" value in the request.
*/
@@ -182,33 +152,4 @@ - (void)testSignUpNewUserRequestNotAnonymous {
XCTAssertTrue([_RPCIssuer.decodedRequest[kReturnSecureTokenKey] boolValue]);
}
-/** @fn testSignUpNewUserRequestOptionalFields
- @brief Tests the encoding of a sign up new user request with optional fields.
- */
-- (void)testSignUpNewUserRequestOptionalFields {
- FIRSignUpNewUserRequest *request =
- [[FIRSignUpNewUserRequest alloc] initWithEmail:kTestEmail
- password:kTestPassword
- displayName:kTestDisplayName
- requestConfiguration:_requestConfiguration];
- request.captchaResponse = kTestCaptchaResponse;
- request.clientType = kTestClientType;
- request.recaptchaVersion = kTestRecaptchaVersion;
- [FIRAuthBackend
- signUpNewUser:request
- callback:^(FIRSignUpNewUserResponse *_Nullable response, NSError *_Nullable error){
- }];
-
- XCTAssertEqualObjects(_RPCIssuer.requestURL.absoluteString, kExpectedAPIURL);
- XCTAssertNotNil(_RPCIssuer.decodedRequest);
- XCTAssert([_RPCIssuer.decodedRequest isKindOfClass:[NSDictionary class]]);
- XCTAssertEqualObjects(_RPCIssuer.decodedRequest[kEmailKey], kTestEmail);
- XCTAssertEqualObjects(_RPCIssuer.decodedRequest[kPasswordKey], kTestPassword);
- XCTAssertEqualObjects(_RPCIssuer.decodedRequest[kDisplayNameKey], kTestDisplayName);
- XCTAssertTrue([_RPCIssuer.decodedRequest[kReturnSecureTokenKey] boolValue]);
- XCTAssertEqualObjects(_RPCIssuer.decodedRequest[kCaptchaResponseKey], kTestCaptchaResponse);
- XCTAssertEqualObjects(_RPCIssuer.decodedRequest[kClientTypeKey], kTestClientType);
- XCTAssertEqualObjects(_RPCIssuer.decodedRequest[kRecaptchaVersionKey], kTestRecaptchaVersion);
-}
-
@end
diff --git a/FirebaseAuth/Tests/Unit/FIRVerifyPasswordRequestTest.m b/FirebaseAuth/Tests/Unit/FIRVerifyPasswordRequestTest.m
index a264f746b48..e5d8dc19f74 100644
--- a/FirebaseAuth/Tests/Unit/FIRVerifyPasswordRequestTest.m
+++ b/FirebaseAuth/Tests/Unit/FIRVerifyPasswordRequestTest.m
@@ -81,27 +81,7 @@
/** @var kTestCaptchaResponse
@brief Fake captchaResponse for testing the request.
*/
-static NSString *const kTestCaptchaResponse = @"testCaptchaResponse";
-
-/** @var kClientTypeKey
- @brief The key for the "clientType" value in the request.
- */
-static NSString *const kClientTypeKey = @"clientType";
-
-/** @var kTestClientType
- @brief Fake clientType for testing the request.
- */
-static NSString *const kTestClientType = @"testClientType";
-
-/** @var kRecaptchaVersionKey
- @brief The key for the "recaptchaVersion" value in the request.
- */
-static NSString *const kRecaptchaVersionKey = @"recaptchaVersion";
-
-/** @var kTestRecaptchaVersion
- @brief Fake recaptchaVersion for testing the request.
- */
-static NSString *const kTestRecaptchaVersion = @"testRecaptchaVersion";
+static NSString *const kTestCaptchaResponse = @"captchaResponse";
/** @var kReturnSecureTokenKey
@brief The key for the "returnSecureToken" value in the request.
@@ -182,8 +162,6 @@ - (void)testVerifyPasswordRequestOptionalFields {
request.pendingIDToken = kTestPendingToken;
request.captchaChallenge = kTestCaptchaChallenge;
request.captchaResponse = kTestCaptchaResponse;
- request.clientType = kTestClientType;
- request.recaptchaVersion = kTestRecaptchaVersion;
[FIRAuthBackend
verifyPassword:request
callback:^(FIRVerifyPasswordResponse *_Nullable response, NSError *_Nullable error){
@@ -195,8 +173,6 @@ - (void)testVerifyPasswordRequestOptionalFields {
XCTAssertEqualObjects(_RPCIssuer.decodedRequest[kPasswordKey], kTestPassword);
XCTAssertEqualObjects(_RPCIssuer.decodedRequest[kCaptchaChallengeKey], kTestCaptchaChallenge);
XCTAssertEqualObjects(_RPCIssuer.decodedRequest[kCaptchaResponseKey], kTestCaptchaResponse);
- XCTAssertEqualObjects(_RPCIssuer.decodedRequest[kClientTypeKey], kTestClientType);
- XCTAssertEqualObjects(_RPCIssuer.decodedRequest[kRecaptchaVersionKey], kTestRecaptchaVersion);
XCTAssertTrue([_RPCIssuer.decodedRequest[kReturnSecureTokenKey] boolValue]);
}
diff --git a/FirebaseCombineSwift/Tests/Unit/Auth/AuthMocks.swift b/FirebaseCombineSwift/Tests/Unit/Auth/AuthMocks.swift
index a1df847b214..0a974e53858 100644
--- a/FirebaseCombineSwift/Tests/Unit/Auth/AuthMocks.swift
+++ b/FirebaseCombineSwift/Tests/Unit/Auth/AuthMocks.swift
@@ -104,17 +104,12 @@ extension AuthBackendImplementationMock {
fatalError("You need to implement \(#function) in your mock.")
}
- func getRecaptchaConfig(_ request: FIRGetRecaptchaConfigRequest,
- callback: @escaping FIRGetRecaptchaConfigResponseCallback) {
- fatalError("You need to implement \(#function) in your mock.")
- }
-
func resetPassword(_ request: FIRResetPasswordRequest,
callback: @escaping FIRResetPasswordCallback) {
fatalError("You need to implement \(#function) in your mock.")
}
- func call(with request: FIRAuthRPCRequest, response: FIRAuthRPCResponse,
+ func post(with request: FIRAuthRPCRequest, response: FIRAuthRPCResponse,
callback: @escaping (Error?) -> Void) {
fatalError("You need to implement \(#function) in your mock.")
}
diff --git a/FirebaseCombineSwift/Tests/Unit/Auth/SignInWithGameCenterTests.swift b/FirebaseCombineSwift/Tests/Unit/Auth/SignInWithGameCenterTests.swift
index b647ba4df5e..eb206164ae4 100644
--- a/FirebaseCombineSwift/Tests/Unit/Auth/SignInWithGameCenterTests.swift
+++ b/FirebaseCombineSwift/Tests/Unit/Auth/SignInWithGameCenterTests.swift
@@ -69,7 +69,7 @@ class SignInWithGameCenterTests: XCTestCase {
var contentType: String?
var handler: FIRAuthBackendRPCIssuerCompletionHandler?
- func asyncCallToURL(with requestConfiguration: FIRAuthRequestConfiguration, url URL: URL,
+ func asyncPostToURL(with requestConfiguration: FIRAuthRequestConfiguration, url URL: URL,
body: Data?, contentType: String,
completionHandler handler: @escaping FIRAuthBackendRPCIssuerCompletionHandler) {
requestURL = URL
diff --git a/FirebaseCombineSwift/Tests/Unit/FirebaseCombine-unit-Bridging-Header.h b/FirebaseCombineSwift/Tests/Unit/FirebaseCombine-unit-Bridging-Header.h
index c413d6f7c36..0d9d6e2feca 100644
--- a/FirebaseCombineSwift/Tests/Unit/FirebaseCombine-unit-Bridging-Header.h
+++ b/FirebaseCombineSwift/Tests/Unit/FirebaseCombine-unit-Bridging-Header.h
@@ -42,8 +42,6 @@
#import "FirebaseAuth/Sources/Backend/RPC/FIRGetOOBConfirmationCodeResponse.h"
#import "FirebaseAuth/Sources/Backend/RPC/FIRGetProjectConfigRequest.h"
#import "FirebaseAuth/Sources/Backend/RPC/FIRGetProjectConfigResponse.h"
-#import "FirebaseAuth/Sources/Backend/RPC/FIRGetRecaptchaConfigRequest.h"
-#import "FirebaseAuth/Sources/Backend/RPC/FIRGetRecaptchaConfigResponse.h"
#import "FirebaseAuth/Sources/Backend/RPC/FIRResetPasswordRequest.h"
#import "FirebaseAuth/Sources/Backend/RPC/FIRResetPasswordResponse.h"
#import "FirebaseAuth/Sources/Backend/RPC/FIRRevokeTokenRequest.h"
diff --git a/Package.swift b/Package.swift
index ebffe579448..6f24cb498b2 100644
--- a/Package.swift
+++ b/Package.swift
@@ -176,10 +176,6 @@ let package = Package(
url: "https://github.com/SlaunchaMan/GCDWebServer.git",
revision: "935e2736044e71e5341663c3cc9a335ba6867a2b"
),
- .package(
- url: "https://github.com/GoogleCloudPlatform/recaptcha-enterprise-mobile-sdk.git",
- "18.2.0" ..< "18.3.0"
- ),
],
targets: [
.target(
@@ -424,7 +420,6 @@ let package = Package(
.product(name: "GULAppDelegateSwizzler", package: "GoogleUtilities"),
.product(name: "GULEnvironment", package: "GoogleUtilities"),
.product(name: "GTMSessionFetcherCore", package: "gtm-session-fetcher"),
- .product(name: "RecaptchaInterop", package: "recaptcha-enterprise-mobile-sdk"),
],
path: "FirebaseAuth/Sources",
publicHeadersPath: "Public",