aboutsummaryrefslogtreecommitdiffhomepage
path: root/Firebase/Auth/Source/RPCs
diff options
context:
space:
mode:
authorGravatar Xiangtian Dai <xiangtian@google.com>2017-07-28 17:43:33 -0700
committerGravatar GitHub <noreply@github.com>2017-07-28 17:43:33 -0700
commit925a1cc0a27a3afb17b862a0740b56e56c3ae669 (patch)
treeda6935aa77f50ae17e0b6f60425c8bd0f1c142e6 /Firebase/Auth/Source/RPCs
parent0abd3444344ea134b0593fcaaf428e82cd190e12 (diff)
Merge from private/auth-master (#159)
* Adds passing state and continue URL in OOBCodes actions. (#82) * Adds actionCodeSettings class (#83) * Adds FIRActionCodeSettings class * Removes iOSAppStoreId to reflect update spec. * Adds “reset password in app” to sample app (#84) * Adds “reset password in app” to sample app * Addresses comments * Addresses comments * Adds @param documentation for actionCodeSettings (#85) Adds @param documentation for actionCodeSettings in FIRGetOOBConfirmationCodeRequest. * Adds request configuration class Adds a class that will comprise of all configurations needed to make a request to the Firebase Auth backend; including APIKey and Language code in the future. * Addresses comments. * Adds Setting Language Add Setting Language Feature to Firebase Auth. - Only adds support for two languages (English and Spanish) in this change. (Also supports two languages in test), more to come after this change is accepted. - For now sample app tests language setting only when using “reset password in app” option, the email sent will be in the current app language. Additional tests to come after change is accepted. * Amends code for unit tests Will add more comprehensive testing when code accepted. * Ecodes strings files in UTF-8 * Addresses comments * Addresses comments * Remove comments in .strings * Adds remaining TC languages to Firebase Auth. * Add line break to .strings files * remove language code english fallback Remove the fallback that sends “en” as the language code to the backend if no language code is specified. * addresses comment * Fixes FIRSecureToken Crash Integrates FIRSecureTokenService and FIRSecureTokenRequest with FIRAuthRequestConfiguration. * Addresses comment * Add auth language input Adds Auth language input to the Sample App in preparation for manual testing. * removes unnecessary comment * address comments * Add app language option Allow user to set the current app language code as the auth language code. This is in preparation for manual testing before release. * Addresses Comment * Adds missing continue URI Adds missing continue URL to Firebear error handling. * Remove unused line Removes unused line from FIRPhoneAuthProvider.m * Moves the new public header to the right place. * Fixes broken macOS build. * Removes trailing spaces. * Addresses review comments.
Diffstat (limited to 'Firebase/Auth/Source/RPCs')
-rw-r--r--Firebase/Auth/Source/RPCs/FIRAuthBackend.h17
-rw-r--r--Firebase/Auth/Source/RPCs/FIRAuthBackend.m79
-rw-r--r--Firebase/Auth/Source/RPCs/FIRAuthRPCRequest.h10
-rw-r--r--Firebase/Auth/Source/RPCs/FIRAuthRequestConfiguration.h47
-rw-r--r--Firebase/Auth/Source/RPCs/FIRAuthRequestConfiguration.m34
-rw-r--r--Firebase/Auth/Source/RPCs/FIRCreateAuthURIRequest.h14
-rw-r--r--Firebase/Auth/Source/RPCs/FIRCreateAuthURIRequest.m4
-rw-r--r--Firebase/Auth/Source/RPCs/FIRDeleteAccountRequest.h18
-rw-r--r--Firebase/Auth/Source/RPCs/FIRDeleteAccountRequest.m8
-rw-r--r--Firebase/Auth/Source/RPCs/FIRGetAccountInfoRequest.h16
-rw-r--r--Firebase/Auth/Source/RPCs/FIRGetAccountInfoRequest.m7
-rw-r--r--Firebase/Auth/Source/RPCs/FIRGetOOBConfirmationCodeRequest.h54
-rw-r--r--Firebase/Auth/Source/RPCs/FIRGetOOBConfirmationCodeRequest.m95
-rw-r--r--Firebase/Auth/Source/RPCs/FIRIdentityToolkitRequest.h15
-rw-r--r--Firebase/Auth/Source/RPCs/FIRIdentityToolkitRequest.m17
-rw-r--r--Firebase/Auth/Source/RPCs/FIRResetPasswordRequest.h18
-rw-r--r--Firebase/Auth/Source/RPCs/FIRResetPasswordRequest.m8
-rw-r--r--Firebase/Auth/Source/RPCs/FIRSecureTokenRequest.h16
-rw-r--r--Firebase/Auth/Source/RPCs/FIRSecureTokenRequest.m28
-rw-r--r--Firebase/Auth/Source/RPCs/FIRSendVerificationCodeRequest.h15
-rw-r--r--Firebase/Auth/Source/RPCs/FIRSendVerificationCodeRequest.m5
-rw-r--r--Firebase/Auth/Source/RPCs/FIRSetAccountInfoRequest.h14
-rw-r--r--Firebase/Auth/Source/RPCs/FIRSetAccountInfoRequest.m5
-rw-r--r--Firebase/Auth/Source/RPCs/FIRSignUpNewUserRequest.h25
-rw-r--r--Firebase/Auth/Source/RPCs/FIRSignUpNewUserRequest.m18
-rw-r--r--Firebase/Auth/Source/RPCs/FIRVerifyAssertionRequest.h17
-rw-r--r--Firebase/Auth/Source/RPCs/FIRVerifyAssertionRequest.m7
-rw-r--r--Firebase/Auth/Source/RPCs/FIRVerifyClientRequest.h13
-rw-r--r--Firebase/Auth/Source/RPCs/FIRVerifyClientRequest.m4
-rw-r--r--Firebase/Auth/Source/RPCs/FIRVerifyCustomTokenRequest.h15
-rw-r--r--Firebase/Auth/Source/RPCs/FIRVerifyCustomTokenRequest.m5
-rw-r--r--Firebase/Auth/Source/RPCs/FIRVerifyPasswordRequest.h14
-rw-r--r--Firebase/Auth/Source/RPCs/FIRVerifyPasswordRequest.m5
-rw-r--r--Firebase/Auth/Source/RPCs/FIRVerifyPhoneNumberRequest.h19
-rw-r--r--Firebase/Auth/Source/RPCs/FIRVerifyPhoneNumberRequest.m12
35 files changed, 526 insertions, 172 deletions
diff --git a/Firebase/Auth/Source/RPCs/FIRAuthBackend.h b/Firebase/Auth/Source/RPCs/FIRAuthBackend.h
index 521cf16..b560644 100644
--- a/Firebase/Auth/Source/RPCs/FIRAuthBackend.h
+++ b/Firebase/Auth/Source/RPCs/FIRAuthBackend.h
@@ -16,6 +16,7 @@
#import <Foundation/Foundation.h>
+@class FIRAuthRequestConfiguration;
@class FIRCreateAuthURIRequest;
@class FIRCreateAuthURIResponse;
@class FIRGetAccountInfoRequest;
@@ -348,18 +349,20 @@ typedef void (^FIRVerifyClientResponseCallback)
*/
@protocol FIRAuthBackendRPCIssuer <NSObject>
-/** @fn asyncPostToURL:body:contentType:completionHandler:
- @brief Asynchronously sends a POST request.
- @param URL URL of the 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 POST response. Invoked asynchronously on the auth global
work queue in the future.
*/
-- (void)asyncPostToURL:(NSURL *)URL
- body:(NSData *)body
- contentType:(NSString *)contentType
- completionHandler:(FIRAuthBackendRPCIssuerCompletionHandler)handler;
+- (void)asyncPostToURLWithRequestConfiguration:(FIRAuthRequestConfiguration *)requestConfiguration
+ URL:(NSURL *)URL
+ body:(NSData *)body
+ contentType:(NSString *)contentType
+ completionHandler:(FIRAuthBackendRPCIssuerCompletionHandler)handler;
@end
diff --git a/Firebase/Auth/Source/RPCs/FIRAuthBackend.m b/Firebase/Auth/Source/RPCs/FIRAuthBackend.m
index b2b5a34..7e31993 100644
--- a/Firebase/Auth/Source/RPCs/FIRAuthBackend.m
+++ b/Firebase/Auth/Source/RPCs/FIRAuthBackend.m
@@ -69,6 +69,11 @@ static NSString *const kClientVersionHeader = @"X-Client-Version";
*/
static NSString *const kIosBundleIdentifierHeader = @"X-Ios-Bundle-Identifier";
+/** @var kFirebaseLocalHeader
+ @brief HTTP header name for the firebase locale.
+ */
+static NSString *const kFirebaseLocalHeader = @"X-Firebase-Locale";
+
/** @var kJSONContentType
@brief The value of the HTTP content-type header for JSON payloads.
*/
@@ -246,6 +251,36 @@ static NSString *const kInvalidMessagePayloadErrorMessage = @"INVALID_MESSAGE_PA
*/
static NSString *const kInvalidRecipientEmailErrorMessage = @"INVALID_RECIPIENT_EMAIL";
+/** @var kMissingIosBundleIDErrorMessage
+ @brief This is the error message the server will respond with if iOS bundle ID is missing but
+ the iOS App store ID is provided.
+ */
+static NSString *const kMissingIosBundleIDErrorMessage = @"MISSING_IOS_BUNDLE_ID";
+
+/** @var kMissingAndroidPackageNameErrorMessage
+ @brief This is the error message the server will respond with if Android Package Name is missing
+ but the flag indicating the app should be installed is set to true.
+ */
+static NSString *const kMissingAndroidPackageNameErrorMessage = @"MISSING_ANDROID_PACKAGE_NAME";
+
+/** @var kUnauthorizedDomainErrorMessage
+ @brief This is the error message the server will respond with if the domain of the continue URL
+ specified is not whitelisted in the firebase console.
+ */
+static NSString *const kUnauthorizedDomainErrorMessage = @"ERROR_UNAUTHORIZED_DOMAIN";
+
+/** @var kInvalidContinueURIErrorMessage
+ @brief This is the error message the server will respond with if the continue URL provided in
+ the request is invalid.
+ */
+static NSString *const kInvalidContinueURIErrorMessage = @"INVALID_CONTINUE_URI";
+
+/** @var kMissingContinueURIErrorMessage
+ @brief This is the error message the server will respond with if there was no continue URI
+ present in a request that required one.
+ */
+static NSString *const kMissingContinueURIErrorMessage = @"MISSING_CONTINUE_URI";
+
/** @var kInvalidPhoneNumberErrorMessage
@brief This is the error message the server will respond with if an incorrectly formatted phone
number is provided.
@@ -427,10 +462,12 @@ static id<FIRAuthBackendImplementation> gBackendImplementation;
return self;
}
-- (void)asyncPostToURL:(NSURL *)URL
- body:(NSData *)body
- contentType:(NSString *)contentType
- completionHandler:(void (^)(NSData *_Nullable, NSError *_Nullable))handler {
+- (void)asyncPostToURLWithRequestConfiguration:(FIRAuthRequestConfiguration *)requestConfiguration
+ URL:(NSURL *)URL
+ body:(NSData *)body
+ contentType:(NSString *)contentType
+ completionHandler:(void (^)(NSData *_Nullable,
+ NSError *_Nullable))handler {
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:URL];
[request setValue:contentType forHTTPHeaderField:@"Content-Type"];
NSString *clientVersion =
@@ -444,7 +481,10 @@ static id<FIRAuthBackendImplementation> gBackendImplementation;
NSString *acceptLanguage = preferredLocalizations.firstObject;
[request setValue:acceptLanguage forHTTPHeaderField:@"Accept-Language"];
}
-
+ NSString *languageCode = requestConfiguration.languageCode;
+ if (languageCode.length) {
+ [request setValue:languageCode forHTTPHeaderField:kFirebaseLocalHeader];
+ }
GTMSessionFetcher* fetcher = [_fetcherService fetcherWithRequest:request];
fetcher.bodyData = body;
[fetcher beginFetchWithCompletionHandler:handler];
@@ -684,10 +724,11 @@ static id<FIRAuthBackendImplementation> gBackendImplementation;
return;
}
- [_RPCIssuer asyncPostToURL:[request requestURL]
- body:bodyData
- contentType:kJSONContentType
- completionHandler:^(NSData *data, NSError *error) {
+ [_RPCIssuer asyncPostToURLWithRequestConfiguration:[request requestConfiguration]
+ URL:[request requestURL]
+ body:bodyData
+ contentType:kJSONContentType
+ completionHandler:^(NSData *data, NSError *error) {
// If there is an error with no body data at all, then this must be a network error.
if (error && !data) {
callback([FIRAuthErrorUtils networkErrorWithUnderlyingError:error]);
@@ -901,6 +942,26 @@ static id<FIRAuthBackendImplementation> gBackendImplementation;
return [FIRAuthErrorUtils invalidRecipientEmailErrorWithMessage:serverDetailErrorMessage];
}
+ if ([shortErrorMessage isEqualToString:kMissingIosBundleIDErrorMessage]) {
+ return [FIRAuthErrorUtils missingIosBundleIDErrorWithMessage:serverDetailErrorMessage];
+ }
+
+ if ([shortErrorMessage isEqualToString:kMissingAndroidPackageNameErrorMessage]) {
+ return [FIRAuthErrorUtils missingAndroidPackageNameErrorWithMessage:serverDetailErrorMessage];
+ }
+
+ if ([shortErrorMessage isEqualToString:kUnauthorizedDomainErrorMessage]) {
+ return [FIRAuthErrorUtils unauthorizedDomainErrorWithMessage:serverDetailErrorMessage];
+ }
+
+ if ([shortErrorMessage isEqualToString:kInvalidContinueURIErrorMessage]) {
+ return [FIRAuthErrorUtils invalidContinueURIErrorWithMessage:serverDetailErrorMessage];
+ }
+
+ if ([shortErrorMessage isEqualToString:kMissingContinueURIErrorMessage]) {
+ return [FIRAuthErrorUtils missingContinueURIErrorWithMessage:serverDetailErrorMessage];
+ }
+
if ([shortErrorMessage isEqualToString:kInvalidPhoneNumberErrorMessage]) {
return [FIRAuthErrorUtils invalidPhoneNumberErrorWithMessage:serverDetailErrorMessage];
}
diff --git a/Firebase/Auth/Source/RPCs/FIRAuthRPCRequest.h b/Firebase/Auth/Source/RPCs/FIRAuthRPCRequest.h
index ddad3cb..cde0bd8 100644
--- a/Firebase/Auth/Source/RPCs/FIRAuthRPCRequest.h
+++ b/Firebase/Auth/Source/RPCs/FIRAuthRPCRequest.h
@@ -16,6 +16,8 @@
#import <Foundation/Foundation.h>
+@class FIRAuthRequestConfiguration;
+
NS_ASSUME_NONNULL_BEGIN
/** @protocol FIRAuthRPCRequest
@@ -35,6 +37,14 @@ NS_ASSUME_NONNULL_BEGIN
*/
- (nullable id)unencodedHTTPRequestBodyWithError:(NSError *_Nullable *_Nullable)error;
+@optional
+
+/** @fn requestConfiguration
+ @brief Obtains the request configurations if available.
+ @return Returns the request configurations.
+ */
+- (FIRAuthRequestConfiguration *)requestConfiguration;
+
@end
NS_ASSUME_NONNULL_END
diff --git a/Firebase/Auth/Source/RPCs/FIRAuthRequestConfiguration.h b/Firebase/Auth/Source/RPCs/FIRAuthRequestConfiguration.h
new file mode 100644
index 0000000..1aec6f6
--- /dev/null
+++ b/Firebase/Auth/Source/RPCs/FIRAuthRequestConfiguration.h
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2017 Google
+ *
+ * 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/Foundation.h>
+
+#import "FIRAuthRPCRequest.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+/** @class FIRAuthRequestConfiguration
+ @brief Defines configurations to be added to a request to Firebase Auth's backend.
+ */
+@interface FIRAuthRequestConfiguration : NSObject
+
+/** @property APIKey
+ @brief The Firebase Auth API key used in the request.
+ */
+@property(nonatomic, copy, readonly) NSString *APIKey;
+
+/** @property LanguageCode
+ @brief The language code used in the request.
+ */
+@property(nonatomic, copy, nullable) NSString *languageCode;
+
+- (nullable instancetype)init NS_UNAVAILABLE;
+
+/** @fn initWithRequestClass:APIKey:authLanguage:
+ @brief Designated initializer.
+ @param APIKey The API key to be used in the request.
+ */
+- (nullable instancetype)initWithAPIKey:(NSString *)APIKey NS_DESIGNATED_INITIALIZER;
+@end
+
+NS_ASSUME_NONNULL_END
diff --git a/Firebase/Auth/Source/RPCs/FIRAuthRequestConfiguration.m b/Firebase/Auth/Source/RPCs/FIRAuthRequestConfiguration.m
new file mode 100644
index 0000000..a4ee5dd
--- /dev/null
+++ b/Firebase/Auth/Source/RPCs/FIRAuthRequestConfiguration.m
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2017 Google
+ *
+ * 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 "FIRAuthRequestConfiguration.h"
+#import "FIRAuthExceptionUtils.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+@implementation FIRAuthRequestConfiguration
+
+- (nullable instancetype)initWithAPIKey:(NSString *)APIKey {
+ self = [super init];
+ if (self) {
+ _APIKey = [APIKey copy];
+ }
+ return self;
+}
+
+@end
+
+NS_ASSUME_NONNULL_END
diff --git a/Firebase/Auth/Source/RPCs/FIRCreateAuthURIRequest.h b/Firebase/Auth/Source/RPCs/FIRCreateAuthURIRequest.h
index bb28826..a4fb6f5 100644
--- a/Firebase/Auth/Source/RPCs/FIRCreateAuthURIRequest.h
+++ b/Firebase/Auth/Source/RPCs/FIRCreateAuthURIRequest.h
@@ -65,21 +65,23 @@ NS_ASSUME_NONNULL_BEGIN
*/
@property(nonatomic, copy, nullable) NSString *appID;
-/** @fn initWithEndpoint:APIKey:
- @brief Please use initWithIdentifier:continueURI:APIKey:
+/** @fn initWithEndpoint:requestConfiguration:requestConfiguration.
+ @brief Please use initWithIdentifier:continueURI:requestConfiguration: instead.
*/
- (nullable instancetype)initWithEndpoint:(NSString *)endpoint
- APIKey:(NSString *)APIKey NS_UNAVAILABLE;
+ requestConfiguration:(FIRAuthRequestConfiguration *)requestConfiguration
+ NS_UNAVAILABLE;
-/** @fn initWithIdentifier:continueURI:APIKey:
+/** @fn initWithIdentifier:continueURI:requestConfiguration:
@brief Designated initializer.
@param identifier The email or federated ID of the user.
@param continueURI The URI to which the IDP redirects the user after the federated login flow.
- @param APIKey The client's API Key.
+ @param requestConfiguration An object containing configurations to be added to the request.
*/
- (nullable instancetype)initWithIdentifier:(NSString *)identifier
continueURI:(NSString *)continueURI
- APIKey:(NSString *)APIKey NS_DESIGNATED_INITIALIZER;
+ requestConfiguration:(FIRAuthRequestConfiguration *)requestConfiguration
+ NS_DESIGNATED_INITIALIZER;
@end
diff --git a/Firebase/Auth/Source/RPCs/FIRCreateAuthURIRequest.m b/Firebase/Auth/Source/RPCs/FIRCreateAuthURIRequest.m
index 6d2b9e9..dae46fb 100644
--- a/Firebase/Auth/Source/RPCs/FIRCreateAuthURIRequest.m
+++ b/Firebase/Auth/Source/RPCs/FIRCreateAuthURIRequest.m
@@ -60,8 +60,8 @@ static NSString *const kAppIDKey = @"appId";
- (nullable instancetype)initWithIdentifier:(NSString *)identifier
continueURI:(NSString *)continueURI
- APIKey:(NSString *)APIKey {
- self = [super initWithEndpoint:kCreateAuthURIEndpoint APIKey:APIKey];
+ requestConfiguration:(FIRAuthRequestConfiguration *)requestConfiguration {
+ self = [super initWithEndpoint:kCreateAuthURIEndpoint requestConfiguration:requestConfiguration];
if (self) {
_identifier = [identifier copy];
_continueURI = [continueURI copy];
diff --git a/Firebase/Auth/Source/RPCs/FIRDeleteAccountRequest.h b/Firebase/Auth/Source/RPCs/FIRDeleteAccountRequest.h
index 1751e54..89a7d26 100644
--- a/Firebase/Auth/Source/RPCs/FIRDeleteAccountRequest.h
+++ b/Firebase/Auth/Source/RPCs/FIRDeleteAccountRequest.h
@@ -27,21 +27,23 @@ NS_ASSUME_NONNULL_BEGIN
*/
@interface FIRDeleteAccountRequest : FIRIdentityToolkitRequest<FIRAuthRPCRequest>
-/** @fn initWithEndpoint:APIKey:
- @brief Please use initWithAPIKey:
+/** @fn initWithEndpoint:requestConfiguration:requestConfiguration.
+ @brief Please use initWitLocalID:accessToken:requestConfiguration instead.
*/
- (nullable instancetype)initWithEndpoint:(NSString *)endpoint
- APIKey:(NSString *)APIKey NS_UNAVAILABLE;
+ requestConfiguration:(FIRAuthRequestConfiguration *)requestConfiguration
+ NS_UNAVAILABLE;
-/** @fn initWithAPIKey:
+/** @fn initWitLocalID:accessToken:requestConfiguration.
@brief Designated initializer.
- @param APIKey The client's API Key.
@param localID The local ID.
@param accessToken The access token.
+ @param requestConfiguration An object containing configurations to be added to the request.
*/
-- (nullable instancetype)initWithAPIKey:(NSString *)APIKey
- localID:(NSString *)localID
- accessToken:(NSString *)accessToken NS_DESIGNATED_INITIALIZER;
+- (nullable instancetype)initWitLocalID:(NSString *)localID
+ accessToken:(NSString *)accessToken
+ requestConfiguration:(FIRAuthRequestConfiguration *)requestConfiguration
+ NS_DESIGNATED_INITIALIZER;
@end
diff --git a/Firebase/Auth/Source/RPCs/FIRDeleteAccountRequest.m b/Firebase/Auth/Source/RPCs/FIRDeleteAccountRequest.m
index 9105ba0..2222210 100644
--- a/Firebase/Auth/Source/RPCs/FIRDeleteAccountRequest.m
+++ b/Firebase/Auth/Source/RPCs/FIRDeleteAccountRequest.m
@@ -44,10 +44,10 @@ static NSString *const kLocalIDKey = @"localId";
NSString *_localID;
}
-- (nullable instancetype)initWithAPIKey:(NSString *)APIKey
- localID:(nonnull NSString *)localID
- accessToken:(nonnull NSString *)accessToken {
- self = [super initWithEndpoint:kDeleteAccountEndpoint APIKey:APIKey];
+- (nullable instancetype)initWitLocalID:(NSString *)localID
+ accessToken:(NSString *)accessToken
+ requestConfiguration:(FIRAuthRequestConfiguration *)requestConfiguration {
+ self = [super initWithEndpoint:kDeleteAccountEndpoint requestConfiguration:requestConfiguration];
if (self) {
_localID = [localID copy];
_accessToken = [accessToken copy];
diff --git a/Firebase/Auth/Source/RPCs/FIRGetAccountInfoRequest.h b/Firebase/Auth/Source/RPCs/FIRGetAccountInfoRequest.h
index b45b933..a5a8a20 100644
--- a/Firebase/Auth/Source/RPCs/FIRGetAccountInfoRequest.h
+++ b/Firebase/Auth/Source/RPCs/FIRGetAccountInfoRequest.h
@@ -32,19 +32,21 @@ NS_ASSUME_NONNULL_BEGIN
*/
@property(nonatomic, copy) NSString *accessToken;
-/** @fn initWithEndpoint:APIKey:
- @brief Please use initWithAPIKey:IDToken:
+/** @fn initWithEndpoint:requestConfiguration:requestConfiguration
+ @brief Please use initWithAccessToken:requestConfiguration: instead.
*/
- (nullable instancetype)initWithEndpoint:(NSString *)endpoint
- APIKey:(NSString *)APIKey NS_UNAVAILABLE;
+ requestConfiguration:(FIRAuthRequestConfiguration *)requestConfiguration
+ NS_UNAVAILABLE;
-/** @fn initWithAPIKey:accessToken:
+/** @fn initWithAccessToken:requestConfiguration
@brief Designated initializer.
- @param APIKey The client's API Key.
@param accessToken The Access Token of the authenticated user.
+ @param requestConfiguration An object containing configurations to be added to the request.
*/
-- (nullable instancetype)initWithAPIKey:(NSString *)APIKey
- accessToken:(NSString *)accessToken NS_DESIGNATED_INITIALIZER;
+- (nullable instancetype)initWithAccessToken:(NSString *)accessToken
+ requestConfiguration:(FIRAuthRequestConfiguration *)requestConfiguration
+ NS_DESIGNATED_INITIALIZER;
@end
diff --git a/Firebase/Auth/Source/RPCs/FIRGetAccountInfoRequest.m b/Firebase/Auth/Source/RPCs/FIRGetAccountInfoRequest.m
index 5c73086..fde79fb 100644
--- a/Firebase/Auth/Source/RPCs/FIRGetAccountInfoRequest.m
+++ b/Firebase/Auth/Source/RPCs/FIRGetAccountInfoRequest.m
@@ -29,9 +29,10 @@ static NSString *const kIDTokenKey = @"idToken";
@implementation FIRGetAccountInfoRequest
-- (nullable instancetype)initWithAPIKey:(NSString *)APIKey
- accessToken:(NSString *)accessToken {
- self = [super initWithEndpoint:kGetAccountInfoEndpoint APIKey:APIKey];
+- (nullable instancetype)initWithAccessToken:(NSString *)accessToken
+ requestConfiguration:(FIRAuthRequestConfiguration *)requestConfiguration {
+ self = [super initWithEndpoint:kGetAccountInfoEndpoint
+ requestConfiguration:requestConfiguration];
if (self) {
_accessToken = [accessToken copy];
}
diff --git a/Firebase/Auth/Source/RPCs/FIRGetOOBConfirmationCodeRequest.h b/Firebase/Auth/Source/RPCs/FIRGetOOBConfirmationCodeRequest.h
index 08ab495..34714e5 100644
--- a/Firebase/Auth/Source/RPCs/FIRGetOOBConfirmationCodeRequest.h
+++ b/Firebase/Auth/Source/RPCs/FIRGetOOBConfirmationCodeRequest.h
@@ -19,6 +19,8 @@
#import "FIRAuthRPCRequest.h"
#import "FIRIdentityToolkitRequest.h"
+@class FIRActionCodeSettings;
+
NS_ASSUME_NONNULL_BEGIN
/** @enum FIRGetOOBConfirmationCodeRequestType
@@ -58,29 +60,69 @@ typedef NS_ENUM(NSInteger, FIRGetOOBConfirmationCodeRequestType) {
*/
@property(nonatomic, copy, nullable, readonly) NSString *accessToken;
+/** @property continueURL
+ @brief This URL represents the state/Continue URL in the form of a universal link.
+ */
+@property(nonatomic, copy, nullable, readonly) NSString *continueURL;
+
+/** @property iOSBundleID
+ @brief The iOS bundle Identifier, if available.
+ */
+@property(nonatomic, copy, nullable, readonly) NSString *iOSBundleID;
+
+/** @property androidPackageName
+ @brief The Android package name, if available.
+ */
+@property(nonatomic, copy, nullable, readonly) NSString *androidPackageName;
+
+/** @property androidMinimumVersion
+ @brief The minimum Android version supported, if available.
+ */
+@property(nonatomic, copy, nullable, readonly) NSString *androidMinimumVersion;
+
+/** @property androidInstallIfNotAvailable
+ @brief Indicates whether or not the Android app should be installed if not already available.
+ */
+@property(nonatomic, assign, readonly) BOOL androidInstallApp;
+
+/** @property handleCodeInApp
+ @brief Indicates whether or not the action code link will open the app directly or after being
+ redirected from a Firebase owned web widget.
+ */
+@property(assign, nonatomic) BOOL handleCodeInApp;
+
/** @fn passwordResetRequestWithEmail:APIKey:
@brief Creates a password reset request.
@param email The user's email address.
- @param APIKey The client's API Key.
+ @param actionCodeSettings An object of FIRActionCodeSettings which specifies action code
+ settings to be applied to the password reset request.
+ @param requestConfiguration An object containing configurations to be added to the request.
@return A password reset request.
*/
-+ (nullable FIRGetOOBConfirmationCodeRequest *)passwordResetRequestWithEmail:(NSString *)email
- APIKey:(NSString *)APIKey;
++ (nullable FIRGetOOBConfirmationCodeRequest *)
+ passwordResetRequestWithEmail:(NSString *)email
+ actionCodeSettings:(nullable FIRActionCodeSettings *)actionCodeSettings
+ requestConfiguration:(FIRAuthRequestConfiguration *)requestConfiguration;
/** @fn verifyEmailRequestWithAccessToken:APIKey:
@brief Creates a password reset request.
@param accessToken The user's STS Access Token.
- @param APIKey The client's API Key.
+ @param actionCodeSettings An object of FIRActionCodeSettings which specifies action code
+ settings to be applied to the email verification request.
+ @param requestConfiguration An object containing configurations to be added to the request.
@return A password reset request.
*/
+ (nullable FIRGetOOBConfirmationCodeRequest *)
- verifyEmailRequestWithAccessToken:(NSString *)accessToken APIKey:(NSString *)APIKey;
+ verifyEmailRequestWithAccessToken:(NSString *)accessToken
+ actionCodeSettings:(nullable FIRActionCodeSettings *)actionCodeSettings
+ requestConfiguration:(FIRAuthRequestConfiguration *)requestConfiguration;
/** @fn init
@brief Please use a factory method.
*/
- (nullable instancetype)initWithEndpoint:(NSString *)endpoint
- APIKey:(NSString *)APIKey NS_UNAVAILABLE;
+ requestConfiguration:(FIRAuthRequestConfiguration *)requestConfiguration
+ NS_UNAVAILABLE;
@end
diff --git a/Firebase/Auth/Source/RPCs/FIRGetOOBConfirmationCodeRequest.m b/Firebase/Auth/Source/RPCs/FIRGetOOBConfirmationCodeRequest.m
index cf0dda5..653eddd 100644
--- a/Firebase/Auth/Source/RPCs/FIRGetOOBConfirmationCodeRequest.m
+++ b/Firebase/Auth/Source/RPCs/FIRGetOOBConfirmationCodeRequest.m
@@ -16,13 +16,15 @@
#import "FIRGetOOBConfirmationCodeRequest.h"
+#import "FIRActionCodeSettings.h"
+
#import "FIRAuthErrorUtils.h"
#import "FIRAuth_Internal.h"
/** @var kEndpoint
@brief The getOobConfirmationCode endpoint name.
*/
-static NSString *const kEndpoint = @"getOobConfirmationCode";
+static NSString *const kGetOobConfirmationCodeEndpoint = @"getOobConfirmationCode";
/** @var kRequestTypeKey
@brief The name of the required "requestType" property in the request.
@@ -40,6 +42,38 @@ static NSString *const kEmailKey = @"email";
*/
static NSString *const kIDTokenKey = @"idToken";
+/** @var kContinueURLKey
+ @brief The key for the "continue URL" value in the request.
+ */
+static NSString *const kContinueURLKey = @"continueUrl";
+
+/** @var kIosBundeIDKey
+ @brief The key for the "iOS Bundle Identifier" value in the request.
+ */
+static NSString *const kIosBundleIDKey = @"iOSBundleId";
+
+/** @var kAndroidPackageNameKey
+ @brief The key for the "Android Package Name" value in the request.
+ */
+static NSString *const kAndroidPackageNameKey = @"androidPackageName";
+
+/** @var kAndroidInstallAppKey
+ @brief The key for the request parameter indicating whether the android app should be installed
+ or not.
+ */
+static NSString *const kAndroidInstallAppKey = @"androidInstallApp";
+
+/** @var kAndroidMinimumVersionKey
+ @brief The key for the "minimum Android version supported" value in the request.
+ */
+static NSString *const kAndroidMinimumVersionKey = @"androidMinimumVersion";
+
+/** @var kCanHandleCodeInAppKey
+ @brief The key for the request parameter indicating whether the action code can be handled in
+ the app or not.
+ */
+static NSString *const kCanHandleCodeInAppKey = @"canHandleCodeInApp";
+
/** @var kPasswordResetRequestTypeValue
@brief The value for the "PASSWORD_RESET" request type.
*/
@@ -57,12 +91,15 @@ static NSString *const kVerifyEmailRequestTypeValue = @"VERIFY_EMAIL";
@param requestType The types of OOB Confirmation Code to request.
@param email The email of the user.
@param accessToken The STS Access Token of the currently signed in user.
- @param APIKey The client's API Key.
+ @param actionCodeSettings An object of FIRActionCodeSettings which specifies action code
+ settings to be applied to the OOB code request.
+ @param requestConfiguration An object containing configurations to be added to the request.
*/
- (nullable instancetype)initWithRequestType:(FIRGetOOBConfirmationCodeRequestType)requestType
email:(nullable NSString *)email
accessToken:(nullable NSString *)accessToken
- APIKey:(nullable NSString *)APIKey
+ actionCodeSettings:(nullable FIRActionCodeSettings *)actionCodeSettings
+ requestConfiguration:(FIRAuthRequestConfiguration *)requestConfiguration
NS_DESIGNATED_INITIALIZER;
@end
@@ -83,31 +120,45 @@ static NSString *const kVerifyEmailRequestTypeValue = @"VERIFY_EMAIL";
}
}
-+ (FIRGetOOBConfirmationCodeRequest *)passwordResetRequestWithEmail:(NSString *)email
- APIKey:(NSString *)APIKey {
++ (FIRGetOOBConfirmationCodeRequest *)
+ passwordResetRequestWithEmail:(NSString *)email
+ actionCodeSettings:(nullable FIRActionCodeSettings *)actionCodeSettings
+ requestConfiguration:(FIRAuthRequestConfiguration *)requestConfiguration {
return [[self alloc] initWithRequestType:FIRGetOOBConfirmationCodeRequestTypePasswordReset
email:email
accessToken:nil
- APIKey:APIKey];
+ actionCodeSettings:actionCodeSettings
+ requestConfiguration:requestConfiguration];
}
+ (FIRGetOOBConfirmationCodeRequest *)
- verifyEmailRequestWithAccessToken:(NSString *)accessToken APIKey:(NSString *)APIKey {
+ verifyEmailRequestWithAccessToken:(NSString *)accessToken
+ actionCodeSettings:(nullable FIRActionCodeSettings *)actionCodeSettings
+ requestConfiguration:(FIRAuthRequestConfiguration *)requestConfiguration {
return [[self alloc] initWithRequestType:FIRGetOOBConfirmationCodeRequestTypeVerifyEmail
email:nil
accessToken:accessToken
- APIKey:APIKey];
+ actionCodeSettings:actionCodeSettings
+ requestConfiguration:requestConfiguration];
}
- (nullable instancetype)initWithRequestType:(FIRGetOOBConfirmationCodeRequestType)requestType
email:(nullable NSString *)email
accessToken:(nullable NSString *)accessToken
- APIKey:(nullable NSString *)APIKey {
- self = [super initWithEndpoint:kEndpoint APIKey:APIKey];
+ actionCodeSettings:(nullable FIRActionCodeSettings *)actionCodeSettings
+ requestConfiguration:(FIRAuthRequestConfiguration *)requestConfiguration {
+ self = [super initWithEndpoint:kGetOobConfirmationCodeEndpoint
+ requestConfiguration:requestConfiguration];
if (self) {
_requestType = requestType;
_email = email;
_accessToken = accessToken;
+ _continueURL = actionCodeSettings.URL.absoluteString;
+ _iOSBundleID = actionCodeSettings.iOSBundleID;
+ _androidPackageName = actionCodeSettings.androidPackageName;
+ _androidMinimumVersion = actionCodeSettings.androidMinimumVersion;
+ _androidInstallApp = actionCodeSettings.androidInstallIfNotAvailable;
+ _handleCodeInApp = actionCodeSettings.handleCodeInApp;
}
return self;
}
@@ -129,6 +180,30 @@ static NSString *const kVerifyEmailRequestTypeValue = @"VERIFY_EMAIL";
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;
+ }
+
return body;
}
diff --git a/Firebase/Auth/Source/RPCs/FIRIdentityToolkitRequest.h b/Firebase/Auth/Source/RPCs/FIRIdentityToolkitRequest.h
index 873788d..b5ca726 100644
--- a/Firebase/Auth/Source/RPCs/FIRIdentityToolkitRequest.h
+++ b/Firebase/Auth/Source/RPCs/FIRIdentityToolkitRequest.h
@@ -16,6 +16,10 @@
#import <Foundation/Foundation.h>
+#import "FIRAuthRequestConfiguration.h"
+
+@class FIRAuthRequestConfiguration;
+
NS_ASSUME_NONNULL_BEGIN
/** @class FIRIdentityToolkitRequest
@@ -41,17 +45,22 @@ NS_ASSUME_NONNULL_BEGIN
/** @fn initWithEndpoint:APIKey:
@brief Designated initializer.
@param endpoint The endpoint name.
- @param APIKey The client's API Key.
+ @param requestConfiguration An object containing configurations to be added to the request.
*/
- (nullable instancetype)initWithEndpoint:(NSString *)endpoint
- APIKey:(NSString *)APIKey
- NS_DESIGNATED_INITIALIZER;
+ requestConfiguration:(FIRAuthRequestConfiguration *)requestConfiguration
+ NS_DESIGNATED_INITIALIZER;
/** @fn requestURL
@brief Gets the request's full URL.
*/
- (NSURL *)requestURL;
+/** @fn requestConfiguration
+ @brief Gets the request's configuration.
+ */
+- (FIRAuthRequestConfiguration *)requestConfiguration;
+
@end
NS_ASSUME_NONNULL_END
diff --git a/Firebase/Auth/Source/RPCs/FIRIdentityToolkitRequest.m b/Firebase/Auth/Source/RPCs/FIRIdentityToolkitRequest.m
index fb51a82..c897066 100644
--- a/Firebase/Auth/Source/RPCs/FIRIdentityToolkitRequest.m
+++ b/Firebase/Auth/Source/RPCs/FIRIdentityToolkitRequest.m
@@ -16,6 +16,8 @@
#import "FIRIdentityToolkitRequest.h"
+NS_ASSUME_NONNULL_BEGIN
+
/** @var kAPIURLFormat
@brief URL format for server API calls.
*/
@@ -26,14 +28,17 @@ static NSString *const kAPIURLFormat = @"https://%@/identitytoolkit/v3/relyingpa
*/
static NSString *gAPIHost = @"www.googleapis.com";
-@implementation FIRIdentityToolkitRequest
+@implementation FIRIdentityToolkitRequest {
+ FIRAuthRequestConfiguration *_requestConfiguration;
+}
- (nullable instancetype)initWithEndpoint:(NSString *)endpoint
- APIKey:(NSString *)APIKey {
+ requestConfiguration:(FIRAuthRequestConfiguration *)requestConfiguration {
self = [super init];
if (self) {
_endpoint = [endpoint copy];
- _APIKey = [APIKey copy];
+ _APIKey = [requestConfiguration.APIKey copy];
+ _requestConfiguration = requestConfiguration;
}
return self;
}
@@ -44,6 +49,10 @@ static NSString *gAPIHost = @"www.googleapis.com";
return URL;
}
+- (FIRAuthRequestConfiguration *)requestConfiguration {
+ return _requestConfiguration;
+}
+
#pragma mark - Internal API for development
+ (NSString *)host {
@@ -54,4 +63,6 @@ static NSString *gAPIHost = @"www.googleapis.com";
gAPIHost = host;
}
+NS_ASSUME_NONNULL_END
+
@end
diff --git a/Firebase/Auth/Source/RPCs/FIRResetPasswordRequest.h b/Firebase/Auth/Source/RPCs/FIRResetPasswordRequest.h
index 66b03ad..701e305 100644
--- a/Firebase/Auth/Source/RPCs/FIRResetPasswordRequest.h
+++ b/Firebase/Auth/Source/RPCs/FIRResetPasswordRequest.h
@@ -33,21 +33,23 @@ NS_ASSUME_NONNULL_BEGIN
*/
@property(nonatomic, copy, readonly) NSString *updatedPassword;
-/** @fn initWithEndpoint:APIKey:
- @brief Please use initWithOOBCode:oobCode: instead.
+/** @fn initWithEndpoint:requestConfiguration:
+ @brief Please use initWithOobCode:newPassword:requestConfiguration: instead.
*/
- (nullable instancetype)initWithEndpoint:(NSString *)endpoint
- APIKey:(NSString *)APIKey NS_UNAVAILABLE;
+ requestConfiguration:(FIRAuthRequestConfiguration *)requestConfiguration
+ NS_UNAVAILABLE;
-/** @fn initWithAPIKey:oobCode:currentPassword:
+/** @fn initWithOobCode:newPassword:requestConfiguration:
@brief Designated initializer.
- @param APIKey The client's API Key.
@param oobCode The OOB Code.
@param newPassword The new password.
+ @param requestConfiguration An object containing configurations to be added to the request.
*/
-- (nullable instancetype)initWithAPIKey:(NSString *)APIKey
- oobCode:(NSString *)oobCode
- newPassword:(nullable NSString *)newPassword NS_DESIGNATED_INITIALIZER;
+- (nullable instancetype)initWithOobCode:(NSString *)oobCode
+ newPassword:(nullable NSString *)newPassword
+ requestConfiguration:(FIRAuthRequestConfiguration *)requestConfiguration;
+
@end
NS_ASSUME_NONNULL_END
diff --git a/Firebase/Auth/Source/RPCs/FIRResetPasswordRequest.m b/Firebase/Auth/Source/RPCs/FIRResetPasswordRequest.m
index 603aa00..27d6d8c 100644
--- a/Firebase/Auth/Source/RPCs/FIRResetPasswordRequest.m
+++ b/Firebase/Auth/Source/RPCs/FIRResetPasswordRequest.m
@@ -33,10 +33,10 @@ static NSString *const kCurrentPasswordKey = @"newPassword";
@implementation FIRResetPasswordRequest
-- (instancetype)initWithAPIKey:(NSString *)APIKey
- oobCode:(NSString *)oobCode
- newPassword:(NSString *)newPassword {
- self = [super initWithEndpoint:kResetPasswordEndpoint APIKey:APIKey];
+- (instancetype)initWithOobCode:(NSString *)oobCode
+ newPassword:(NSString *)newPassword
+ requestConfiguration:(FIRAuthRequestConfiguration *)requestConfiguration {
+ self = [super initWithEndpoint:kResetPasswordEndpoint requestConfiguration:requestConfiguration];
if (self) {
_oobCode = oobCode;
_updatedPassword = newPassword;
diff --git a/Firebase/Auth/Source/RPCs/FIRSecureTokenRequest.h b/Firebase/Auth/Source/RPCs/FIRSecureTokenRequest.h
index 44c16b1..14722fa 100644
--- a/Firebase/Auth/Source/RPCs/FIRSecureTokenRequest.h
+++ b/Firebase/Auth/Source/RPCs/FIRSecureTokenRequest.h
@@ -71,19 +71,22 @@ typedef NS_ENUM(NSUInteger, FIRSecureTokenRequestGrantType) {
/** @fn authCodeRequestWithCode:
@brief Creates an authorization code request with the given code (legacy Gitkit "ID Token").
@param code The authorization code (legacy Gitkit "ID Token").
- @param APIKey The client's API Key.
+ @param requestConfiguration An object containing configurations to be added to the request.
@return An authorization request.
*/
-+ (FIRSecureTokenRequest *)authCodeRequestWithCode:(NSString *)code APIKey:(NSString *)APIKey;
++ (FIRSecureTokenRequest *)authCodeRequestWithCode:(NSString *)code
+ requestConfiguration:(FIRAuthRequestConfiguration *)
+ requestConfiguration;
/** @fn refreshRequestWithCode:
@brief Creates a refresh request with the given refresh token.
@param refreshToken The refresh token.
- @param APIKey The client's API Key.
+ @param requestConfiguration An object containing configurations to be added to the request.
@return A refresh request.
*/
+ (FIRSecureTokenRequest *)refreshRequestWithRefreshToken:(NSString *)refreshToken
- APIKey:(NSString *)APIKey;
+ requestConfiguration:(FIRAuthRequestConfiguration *)
+ requestConfiguration;
/** @fn init
@brief Please use initWithGrantType:scope:refreshToken:code:
@@ -96,13 +99,14 @@ typedef NS_ENUM(NSUInteger, FIRSecureTokenRequestGrantType) {
@param scope The scopes requested.
@param refreshToken The client's refresh token (for refresh requests.)
@param code The client's authorization code (Gitkit ID Token) (for authorization code requests.)
- @param APIKey The client's API Key.
+ @param requestConfiguration An object containing configurations to be added to the request.
*/
- (nullable instancetype)initWithGrantType:(FIRSecureTokenRequestGrantType)grantType
scope:(nullable NSString *)scope
refreshToken:(nullable NSString *)refreshToken
code:(nullable NSString *)code
- APIKey:(NSString *)APIKey NS_DESIGNATED_INITIALIZER;
+ requestConfiguration:(FIRAuthRequestConfiguration *)requestConfiguration
+ NS_DESIGNATED_INITIALIZER;
@end
diff --git a/Firebase/Auth/Source/RPCs/FIRSecureTokenRequest.m b/Firebase/Auth/Source/RPCs/FIRSecureTokenRequest.m
index 1983542..9c39e1e 100644
--- a/Firebase/Auth/Source/RPCs/FIRSecureTokenRequest.m
+++ b/Firebase/Auth/Source/RPCs/FIRSecureTokenRequest.m
@@ -15,6 +15,7 @@
*/
#import "FIRSecureTokenRequest.h"
+#import "FIRAuthRequestConfiguration.h"
/** @var kFIRSecureTokenServiceGetTokenURLFormat
@brief The format of the secure token service URLs. Requires string format substitution with
@@ -57,23 +58,31 @@ static NSString *const kCodeKey = @"code";
*/
static NSString *gAPIHost = @"securetoken.googleapis.com";
-@implementation FIRSecureTokenRequest
+@implementation FIRSecureTokenRequest {
+ /** @var _requestConfiguration
+ @brief Contains configuration relevant to the request.
+ */
+ FIRAuthRequestConfiguration *_requestConfiguration;
+}
-+ (FIRSecureTokenRequest *)authCodeRequestWithCode:(NSString *)code APIKey:(NSString *)APIKey {
++ (FIRSecureTokenRequest *)authCodeRequestWithCode:(NSString *)code
+ requestConfiguration:(FIRAuthRequestConfiguration *)
+ requestConfiguration {
return [[self alloc] initWithGrantType:FIRSecureTokenRequestGrantTypeAuthorizationCode
scope:nil
refreshToken:nil
code:code
- APIKey:APIKey];
+ requestConfiguration:requestConfiguration];
}
+ (FIRSecureTokenRequest *)refreshRequestWithRefreshToken:(NSString *)refreshToken
- APIKey:(NSString *)APIKey {
+ requestConfiguration:(FIRAuthRequestConfiguration *)
+ requestConfiguration {
return [[self alloc] initWithGrantType:FIRSecureTokenRequestGrantTypeRefreshToken
scope:nil
refreshToken:refreshToken
code:nil
- APIKey:APIKey];
+ requestConfiguration:requestConfiguration];
}
/** @fn grantTypeStringWithGrantType:
@@ -93,18 +102,23 @@ static NSString *gAPIHost = @"securetoken.googleapis.com";
scope:(nullable NSString *)scope
refreshToken:(nullable NSString *)refreshToken
code:(nullable NSString *)code
- APIKey:(NSString *)APIKey {
+ requestConfiguration:(FIRAuthRequestConfiguration *)requestConfiguration {
self = [super init];
if (self) {
_grantType = grantType;
_scope = [scope copy];
_refreshToken = [refreshToken copy];
_code = [code copy];
- _APIKey = [APIKey copy];
+ _APIKey = [requestConfiguration.APIKey copy];
+ _requestConfiguration = requestConfiguration;
}
return self;
}
+- (FIRAuthRequestConfiguration *)requestConfiguration {
+ return _requestConfiguration;
+}
+
- (NSURL *)requestURL {
NSString *URLString =
[NSString stringWithFormat:kFIRSecureTokenServiceGetTokenURLFormat, gAPIHost, _APIKey];
diff --git a/Firebase/Auth/Source/RPCs/FIRSendVerificationCodeRequest.h b/Firebase/Auth/Source/RPCs/FIRSendVerificationCodeRequest.h
index 596fb8c..9a5c41c 100644
--- a/Firebase/Auth/Source/RPCs/FIRSendVerificationCodeRequest.h
+++ b/Firebase/Auth/Source/RPCs/FIRSendVerificationCodeRequest.h
@@ -35,21 +35,24 @@ NS_ASSUME_NONNULL_BEGIN
*/
@property(nonatomic, strong, readonly) FIRAuthAppCredential *appCredential;
-/** @fn initWithEndpoint:APIKey:
- @brief Please use initWithPhoneNumber:APIKey:
+/** @fn initWithEndpoint:requestConfiguration:
+ @brief Please use initWithPhoneNumber:appCredentials:requestConfiguration: instead.
*/
- (nullable instancetype)initWithEndpoint:(NSString *)endpoint
- APIKey:(NSString *)APIKey NS_UNAVAILABLE;
+ requestConfiguration:(FIRAuthRequestConfiguration *)requestConfiguration
+ NS_UNAVAILABLE;
-/** @fn initWithPhoneNumber:APIKey:
+/** @fn initWithPhoneNumber:appCredentials:requestConfiguration:
@brief Designated initializer.
@param phoneNumber The phone number to which the verification code is to be sent.
@param appCredential The credential that proves the identity of the app.
- @param APIKey The client's API Key.
+ @param requestConfiguration An object containing configurations to be added to the request.
*/
- (nullable instancetype)initWithPhoneNumber:(NSString *)phoneNumber
appCredential:(FIRAuthAppCredential *)appCredential
- APIKey:(NSString *)APIKey NS_DESIGNATED_INITIALIZER;
+ requestConfiguration:(FIRAuthRequestConfiguration *)requestConfiguration
+ NS_DESIGNATED_INITIALIZER;
+
@end
diff --git a/Firebase/Auth/Source/RPCs/FIRSendVerificationCodeRequest.m b/Firebase/Auth/Source/RPCs/FIRSendVerificationCodeRequest.m
index d97c90a..2f33e02 100644
--- a/Firebase/Auth/Source/RPCs/FIRSendVerificationCodeRequest.m
+++ b/Firebase/Auth/Source/RPCs/FIRSendVerificationCodeRequest.m
@@ -45,8 +45,9 @@ static NSString *const kSecretKey = @"iosSecret";
- (nullable instancetype)initWithPhoneNumber:(NSString *)phoneNumber
appCredential:(FIRAuthAppCredential *)appCredential
- APIKey:(NSString *)APIKey {
- self = [super initWithEndpoint:kSendVerificationCodeEndPoint APIKey:APIKey];
+ requestConfiguration:(FIRAuthRequestConfiguration *)requestConfiguration {
+ self = [super initWithEndpoint:kSendVerificationCodeEndPoint
+ requestConfiguration:requestConfiguration];
if (self) {
_phoneNumber = [phoneNumber copy];
_appCredential = appCredential;
diff --git a/Firebase/Auth/Source/RPCs/FIRSetAccountInfoRequest.h b/Firebase/Auth/Source/RPCs/FIRSetAccountInfoRequest.h
index 4816474..0e0e18f 100644
--- a/Firebase/Auth/Source/RPCs/FIRSetAccountInfoRequest.h
+++ b/Firebase/Auth/Source/RPCs/FIRSetAccountInfoRequest.h
@@ -132,17 +132,19 @@ extern NSString *const FIRSetAccountInfoUserAttributePassword;
*/
@property(nonatomic, assign) BOOL returnSecureToken;
-/** @fn initWithEndpoint:APIKey:
- @brief Please use initWithAPIKey:
+/** @fn initWithEndpoint:requestConfiguration:
+ @brief Please use initWithAPIKey:email:password:displayName:requestConfiguration instead.
*/
- (nullable instancetype)initWithEndpoint:(NSString *)endpoint
- APIKey:(NSString *)APIKey NS_UNAVAILABLE;
+ requestConfiguration:(FIRAuthRequestConfiguration *)requestConfiguration
+ NS_UNAVAILABLE;
-/** @fn initWithAPIKey:
+/** @fn initWithRequestConfiguration:
@brief Designated initializer.
- @param APIKey The client's API Key.
+ @param requestConfiguration An object containing configurations to be added to the request.
*/
-- (nullable instancetype)initWithAPIKey:(NSString *)APIKey NS_DESIGNATED_INITIALIZER;
+- (nullable instancetype)initWithRequestConfiguration:
+ (FIRAuthRequestConfiguration *)requestConfiguration NS_DESIGNATED_INITIALIZER;
@end
diff --git a/Firebase/Auth/Source/RPCs/FIRSetAccountInfoRequest.m b/Firebase/Auth/Source/RPCs/FIRSetAccountInfoRequest.m
index 5b202a4..f455d47 100644
--- a/Firebase/Auth/Source/RPCs/FIRSetAccountInfoRequest.m
+++ b/Firebase/Auth/Source/RPCs/FIRSetAccountInfoRequest.m
@@ -113,8 +113,9 @@ static NSString *const kReturnSecureTokenKey = @"returnSecureToken";
@implementation FIRSetAccountInfoRequest
-- (nullable instancetype)initWithAPIKey:(NSString *)APIKey {
- self = [super initWithEndpoint:kSetAccountInfoEndpoint APIKey:APIKey];
+- (nullable instancetype)initWithRequestConfiguration:
+ (FIRAuthRequestConfiguration *)requestConfiguration {
+ self = [super initWithEndpoint:kSetAccountInfoEndpoint requestConfiguration:requestConfiguration];
if (self) {
_returnSecureToken = YES;
}
diff --git a/Firebase/Auth/Source/RPCs/FIRSignUpNewUserRequest.h b/Firebase/Auth/Source/RPCs/FIRSignUpNewUserRequest.h
index 46b47d5..06d2cfe 100644
--- a/Firebase/Auth/Source/RPCs/FIRSignUpNewUserRequest.h
+++ b/Firebase/Auth/Source/RPCs/FIRSignUpNewUserRequest.h
@@ -44,23 +44,28 @@ NS_ASSUME_NONNULL_BEGIN
*/
@property(nonatomic, assign) BOOL returnSecureToken;
-/** @fn initWithEndpoint:APIKey:
- @brief Please use initWithEmail:password:APIKey:
+/** @fn initWithEndpoint:requestConfiguration:
+ @brief Please use initWithAPIKey:email:password:displayName:requestConfiguration instead.
*/
- (nullable instancetype)initWithEndpoint:(NSString *)endpoint
- APIKey:(NSString *)APIKey NS_UNAVAILABLE;
-/** @fn initWithAPIKey:
+ requestConfiguration:(FIRAuthRequestConfiguration *)requestConfiguration
+ NS_UNAVAILABLE;
+
+/** @fn initWithEndpoint:requestConfiguration:
@brief initializer for anonymous sign-in.
*/
-- (nullable instancetype)initWithAPIKey:(NSString *)APIKey;
+- (nullable instancetype)initWithRequestConfiguration:
+ (FIRAuthRequestConfiguration *)requestConfiguration;
-/** @fn initWithAPIKey:email:password:
+/** @fn initWithAPIKey:email:password:displayName:requestConfiguration
@brief Designated initializer.
+ @param requestConfiguration An object containing configurations to be added to the request.
*/
-- (nullable instancetype)initWithAPIKey:(NSString *)APIKey
- email:(nullable NSString *)email
- password:(nullable NSString *)password
- displayName:(nullable NSString *)displayName NS_DESIGNATED_INITIALIZER;
+- (nullable instancetype)initWithEmail:(nullable NSString *)email
+ password:(nullable NSString *)password
+ displayName:(nullable NSString *)displayName
+ requestConfiguration:(FIRAuthRequestConfiguration *)requestConfiguration
+ NS_DESIGNATED_INITIALIZER;
@end
diff --git a/Firebase/Auth/Source/RPCs/FIRSignUpNewUserRequest.m b/Firebase/Auth/Source/RPCs/FIRSignUpNewUserRequest.m
index af60b11..52a0215 100644
--- a/Firebase/Auth/Source/RPCs/FIRSignUpNewUserRequest.m
+++ b/Firebase/Auth/Source/RPCs/FIRSignUpNewUserRequest.m
@@ -43,11 +43,11 @@ static NSString *const kReturnSecureTokenKey = @"returnSecureToken";
@implementation FIRSignUpNewUserRequest
-- (nullable instancetype)initWithAPIKey:(NSString *)APIKey
- email:(NSString *)email
- password:(NSString *)password
- displayName:(NSString *)displayName {
- self = [super initWithEndpoint:kSignupNewUserEndpoint APIKey:APIKey];
+- (nullable instancetype)initWithEmail:(nullable NSString *)email
+ password:(nullable NSString *)password
+ displayName:(nullable NSString *)displayName
+ requestConfiguration:(FIRAuthRequestConfiguration *)requestConfiguration {
+ self = [super initWithEndpoint:kSignupNewUserEndpoint requestConfiguration:requestConfiguration];
if (self) {
_email = [email copy];
_password = [password copy];
@@ -57,8 +57,12 @@ static NSString *const kReturnSecureTokenKey = @"returnSecureToken";
return self;
}
-- (nullable instancetype)initWithAPIKey:(NSString *)APIKey{
- self = [self initWithAPIKey:APIKey email:nil password:nil displayName:nil];
+- (nullable instancetype)initWithRequestConfiguration:
+ (FIRAuthRequestConfiguration *)requestConfiguration {
+ self = [self initWithEmail:nil
+ password:nil
+ displayName:nil
+ requestConfiguration:requestConfiguration];
return self;
}
diff --git a/Firebase/Auth/Source/RPCs/FIRVerifyAssertionRequest.h b/Firebase/Auth/Source/RPCs/FIRVerifyAssertionRequest.h
index 3202b47..3136b80 100644
--- a/Firebase/Auth/Source/RPCs/FIRVerifyAssertionRequest.h
+++ b/Firebase/Auth/Source/RPCs/FIRVerifyAssertionRequest.h
@@ -81,19 +81,22 @@ NS_ASSUME_NONNULL_BEGIN
*/
@property(nonatomic, assign) BOOL autoCreate;
-/** @fn initWithEndpoint:APIKey:
- @brief Please use initWithAPIKey:
+/** @fn initWithEndpoint:requestConfiguration:
+ @brief Please use initWithProviderID:requestConfifuration instead.
*/
- (nullable instancetype)initWithEndpoint:(NSString *)endpoint
- APIKey:(NSString *)APIKey NS_UNAVAILABLE;
+ requestConfiguration:(FIRAuthRequestConfiguration *)requestConfiguration
+ NS_UNAVAILABLE;
-/** @fn initWithAPIKey:
+/** @fn initWithProviderID:requestConfifuration
@brief Designated initializer.
- @param APIKey The client's API Key.
@param providerID The auth provider's ID.
+ @param requestConfiguration An object containing configurations to be added to the request.
+
*/
-- (nullable instancetype)initWithAPIKey:(NSString *)APIKey
- providerID:(NSString *)providerID NS_DESIGNATED_INITIALIZER;
+- (nullable instancetype)initWithProviderID:(NSString *)providerID
+ requestConfiguration:(FIRAuthRequestConfiguration *)requestConfiguration
+ NS_DESIGNATED_INITIALIZER;
@end
diff --git a/Firebase/Auth/Source/RPCs/FIRVerifyAssertionRequest.m b/Firebase/Auth/Source/RPCs/FIRVerifyAssertionRequest.m
index b31ae42..2251c42 100644
--- a/Firebase/Auth/Source/RPCs/FIRVerifyAssertionRequest.m
+++ b/Firebase/Auth/Source/RPCs/FIRVerifyAssertionRequest.m
@@ -82,9 +82,10 @@ static NSString *const kReturnSecureTokenKey = @"returnSecureToken";
@implementation FIRVerifyAssertionRequest
-- (nullable instancetype)initWithAPIKey:(NSString *)APIKey
- providerID:(nonnull NSString *)providerID{
- self = [super initWithEndpoint:kVerifyAssertionEndpoint APIKey:APIKey];
+- (nullable instancetype)initWithProviderID:(NSString *)providerID
+ requestConfiguration:(FIRAuthRequestConfiguration *)requestConfiguration {
+ self = [super initWithEndpoint:kVerifyAssertionEndpoint
+ requestConfiguration:requestConfiguration];
if (self) {
_providerID = providerID;
_returnSecureToken = YES;
diff --git a/Firebase/Auth/Source/RPCs/FIRVerifyClientRequest.h b/Firebase/Auth/Source/RPCs/FIRVerifyClientRequest.h
index b5da6b8..b6732a4 100644
--- a/Firebase/Auth/Source/RPCs/FIRVerifyClientRequest.h
+++ b/Firebase/Auth/Source/RPCs/FIRVerifyClientRequest.h
@@ -32,21 +32,24 @@ NS_ASSUME_NONNULL_BEGIN
*/
@property(nonatomic, assign, readonly) BOOL isSandbox;
-/** @fn initWithEndpoint:APIKey:
- @brief Please use initWithAppToken:isSandbox: instead.
+/** @fn initWithEndpoint:requestConfiguration:
+ @brief Please use initWithToken:requestConfiguration: instead.
*/
- (nullable instancetype)initWithEndpoint:(NSString *)endpoint
- APIKey:(NSString *)APIKey NS_UNAVAILABLE;
+ requestConfiguration:(FIRAuthRequestConfiguration *)requestConfiguration
+ NS_UNAVAILABLE;
-/** @fn initWithAppToken:isSandbox:
+/** @fn initWithAppToken:isSandbox:requestConfiguration:
@brief Designated initializer.
@param appToken The APNS device token.
@param isSandbox The flag indicating whether or not the app token provided is for Sandbox or
Production.
+ @param requestConfiguration An object containing configurations to be added to the request.
*/
- (nullable instancetype)initWithAppToken:(NSString *)appToken
isSandbox:(BOOL)isSandbox
- APIKey:(NSString *)APIKey NS_DESIGNATED_INITIALIZER;
+ requestConfiguration:(FIRAuthRequestConfiguration *)requestConfiguration
+ NS_DESIGNATED_INITIALIZER;
@end
diff --git a/Firebase/Auth/Source/RPCs/FIRVerifyClientRequest.m b/Firebase/Auth/Source/RPCs/FIRVerifyClientRequest.m
index 7b4b469..4a102e6 100644
--- a/Firebase/Auth/Source/RPCs/FIRVerifyClientRequest.m
+++ b/Firebase/Auth/Source/RPCs/FIRVerifyClientRequest.m
@@ -38,8 +38,8 @@ static NSString *const kIsSandboxKey = @"isSandbox";
- (nullable instancetype)initWithAppToken:(NSString *)appToken
isSandbox:(BOOL)isSandbox
- APIKey:(NSString *)APIKey {
- self = [super initWithEndpoint:kVerifyClientEndpoint APIKey:APIKey];
+ requestConfiguration:(FIRAuthRequestConfiguration *)requestConfiguration {
+ self = [super initWithEndpoint:kVerifyClientEndpoint requestConfiguration:requestConfiguration];
if (self) {
_appToken = appToken;
_isSandbox = isSandbox;
diff --git a/Firebase/Auth/Source/RPCs/FIRVerifyCustomTokenRequest.h b/Firebase/Auth/Source/RPCs/FIRVerifyCustomTokenRequest.h
index 20f3f4d..84bad05 100644
--- a/Firebase/Auth/Source/RPCs/FIRVerifyCustomTokenRequest.h
+++ b/Firebase/Auth/Source/RPCs/FIRVerifyCustomTokenRequest.h
@@ -37,19 +37,20 @@ NS_ASSUME_NONNULL_BEGIN
*/
@property(nonatomic, assign) BOOL returnSecureToken;
-/** @fn initWithEndpoint:APIKey:
- @brief Please use initWithToken:APIKey:
+/** @fn initWithEndpoint:requestConfiguration:
+ @brief Please use initWithToken:requestConfiguration: instead.
*/
-- (nullable instancetype)initWithEndpoint:(NSString *)endpoint
- APIKey:(NSString *)APIKey NS_UNAVAILABLE;
+- (nullable instancetype)initWithEndpoint:(NSString *)endpoint requestConfiguration:
+ (FIRAuthRequestConfiguration *)requestConfiguration NS_UNAVAILABLE;
-/** @fn initWithToken:APIKey:
+/** @fn initWithToken:requestConfiguration:
@brief Designated initializer.
@param token The self-signed token from the client's BYOAuth server.
- @param APIKey The client's API Key.
+ @param requestConfiguration An object containing configurations to be added to the request.
*/
- (nullable instancetype)initWithToken:(NSString *)token
- APIKey:(NSString *)APIKey NS_DESIGNATED_INITIALIZER;
+ requestConfiguration:(FIRAuthRequestConfiguration *)requestConfiguration
+ NS_DESIGNATED_INITIALIZER;
@end
diff --git a/Firebase/Auth/Source/RPCs/FIRVerifyCustomTokenRequest.m b/Firebase/Auth/Source/RPCs/FIRVerifyCustomTokenRequest.m
index 63d72d1..79e60f4 100644
--- a/Firebase/Auth/Source/RPCs/FIRVerifyCustomTokenRequest.m
+++ b/Firebase/Auth/Source/RPCs/FIRVerifyCustomTokenRequest.m
@@ -34,8 +34,9 @@ static NSString *const kReturnSecureTokenKey = @"returnSecureToken";
@implementation FIRVerifyCustomTokenRequest
- (nullable instancetype)initWithToken:(NSString *)token
- APIKey:(NSString *)APIKey {
- self = [super initWithEndpoint:kVerifyCustomTokenEndpoint APIKey:APIKey];
+ requestConfiguration:(FIRAuthRequestConfiguration *)requestConfiguration {
+ self = [super initWithEndpoint:kVerifyCustomTokenEndpoint
+ requestConfiguration:requestConfiguration];
if (self) {
_token = [token copy];
_returnSecureToken = YES;
diff --git a/Firebase/Auth/Source/RPCs/FIRVerifyPasswordRequest.h b/Firebase/Auth/Source/RPCs/FIRVerifyPasswordRequest.h
index ba54bce..39eb388 100644
--- a/Firebase/Auth/Source/RPCs/FIRVerifyPasswordRequest.h
+++ b/Firebase/Auth/Source/RPCs/FIRVerifyPasswordRequest.h
@@ -58,21 +58,23 @@ NS_ASSUME_NONNULL_BEGIN
*/
@property(nonatomic, assign) BOOL returnSecureToken;
-/** @fn initWithEndpoint:APIKey:
- @brief Please use initWithEmail:password:APIKey:
+/** @fn initWithEndpoint:requestConfiguration:
+ @brief Please use initWithEmail:password:requestConfiguration:
*/
- (nullable instancetype)initWithEndpoint:(NSString *)endpoint
- APIKey:(NSString *)APIKey NS_UNAVAILABLE;
+ requestConfiguration:(FIRAuthRequestConfiguration *)requestConfiguration
+ NS_UNAVAILABLE;
-/** @fn initWithEmail:password:APIKey:
+/** @fn initWithEmail:password:requestConfiguration:
@brief Designated initializer.
@param email The email of the user.
@param password The password inputed by the user.
- @param APIKey The client's API Key.
+ @param requestConfiguration The configu
*/
- (nullable instancetype)initWithEmail:(NSString *)email
password:(NSString *)password
- APIKey:(NSString *)APIKey NS_DESIGNATED_INITIALIZER;
+ requestConfiguration:(FIRAuthRequestConfiguration *)requestConfiguration
+ NS_DESIGNATED_INITIALIZER;
@end
diff --git a/Firebase/Auth/Source/RPCs/FIRVerifyPasswordRequest.m b/Firebase/Auth/Source/RPCs/FIRVerifyPasswordRequest.m
index 7a9da8b..515a425 100644
--- a/Firebase/Auth/Source/RPCs/FIRVerifyPasswordRequest.m
+++ b/Firebase/Auth/Source/RPCs/FIRVerifyPasswordRequest.m
@@ -55,8 +55,9 @@ static NSString *const kReturnSecureTokenKey = @"returnSecureToken";
- (nullable instancetype)initWithEmail:(NSString *)email
password:(NSString *)password
- APIKey:(NSString *)APIKey {
- self = [super initWithEndpoint:kVerifyPasswordEndpoint APIKey:APIKey];
+ requestConfiguration:(nonnull FIRAuthRequestConfiguration *)requestConfiguration {
+ self = [super initWithEndpoint:kVerifyPasswordEndpoint
+ requestConfiguration:requestConfiguration];
if (self) {
_email = [email copy];
_password = [password copy];
diff --git a/Firebase/Auth/Source/RPCs/FIRVerifyPhoneNumberRequest.h b/Firebase/Auth/Source/RPCs/FIRVerifyPhoneNumberRequest.h
index 06039b9..b091d62 100644
--- a/Firebase/Auth/Source/RPCs/FIRVerifyPhoneNumberRequest.h
+++ b/Firebase/Auth/Source/RPCs/FIRVerifyPhoneNumberRequest.h
@@ -47,31 +47,34 @@ NS_ASSUME_NONNULL_BEGIN
*/
@property(nonatomic, readonly, nonnull) NSString *phoneNumber;
-/** @fn initWithEndpoint:APIKey:
- @brief Please use initWithPhoneNumber:APIKey:
+/** @fn initWithEndpoint:requestConfiguration:
+ @brief Please use initWithVerificationID:verificationCode:requestConfiguration
*/
- (nullable instancetype)initWithEndpoint:(NSString *)endpoint
- APIKey:(NSString *)APIKey NS_UNAVAILABLE;
+ requestConfiguration:(FIRAuthRequestConfiguration *)requestConfiguration
+ NS_UNAVAILABLE;
/** @fn initWithTemporaryProof:phoneNumberAPIKey
@brief Designated initializer.
@param temporaryProof The temporary proof sent by the backed.
@param phoneNumber The phone number associated with the credential to be signed in.
- @param APIKey The client's API Key.
+ @param requestConfiguration An object containing configurations to be added to the request.
*/
- (nullable instancetype)initWithTemporaryProof:(NSString *)temporaryProof
phoneNumber:(NSString *)phoneNumber
- APIKey:(NSString *)APIKey NS_DESIGNATED_INITIALIZER;
+ requestConfiguration:(FIRAuthRequestConfiguration *)requestConfiguration
+ NS_DESIGNATED_INITIALIZER;
-/** @fn initWithVerificationID:verificationCode:APIKey
+/** @fn initWithVerificationID:verificationCode:requestConfiguration
@brief Designated initializer.
@param verificationID The verification ID obtained from the response of @c sendVerificationCode.
@param verificationCode The verification code provided by the user.
- @param APIKey The client's API Key.
+ @param requestConfiguration An object containing configurations to be added to the request.
*/
- (nullable instancetype)initWithVerificationID:(NSString *)verificationID
verificationCode:(NSString *)verificationCode
- APIKey:(NSString *)APIKey NS_DESIGNATED_INITIALIZER;
+ requestConfiguration:(FIRAuthRequestConfiguration *)requestConfiguration
+ NS_DESIGNATED_INITIALIZER;
@end
diff --git a/Firebase/Auth/Source/RPCs/FIRVerifyPhoneNumberRequest.m b/Firebase/Auth/Source/RPCs/FIRVerifyPhoneNumberRequest.m
index b3d1054..b859693 100644
--- a/Firebase/Auth/Source/RPCs/FIRVerifyPhoneNumberRequest.m
+++ b/Firebase/Auth/Source/RPCs/FIRVerifyPhoneNumberRequest.m
@@ -52,8 +52,10 @@ static NSString *const kPhoneNumberKey = @"phoneNumber";
- (nullable instancetype)initWithTemporaryProof:(NSString *)temporaryProof
phoneNumber:(NSString *)phoneNumber
- APIKey:(NSString *)APIKey {
- self = [super initWithEndpoint:kVerifyPhoneNumberEndPoint APIKey:APIKey];
+ requestConfiguration:
+ (FIRAuthRequestConfiguration *)requestConfiguration {
+ self = [super initWithEndpoint:kVerifyPhoneNumberEndPoint
+ requestConfiguration:requestConfiguration];
if (self) {
_temporaryProof = [temporaryProof copy];
_phoneNumber = [phoneNumber copy];
@@ -63,8 +65,10 @@ static NSString *const kPhoneNumberKey = @"phoneNumber";
- (nullable instancetype)initWithVerificationID:(NSString *)verificationID
verificationCode:(NSString *)verificationCode
- APIKey:(NSString *)APIKey {
- self = [super initWithEndpoint:kVerifyPhoneNumberEndPoint APIKey:APIKey];
+ requestConfiguration:
+ (FIRAuthRequestConfiguration *)requestConfiguration {
+ self = [super initWithEndpoint:kVerifyPhoneNumberEndPoint
+ requestConfiguration:requestConfiguration];
if (self) {
_verificationID = verificationID;
_verificationCode = verificationCode;