From 5b7e8570291e94de60297a625baba73b56516614 Mon Sep 17 00:00:00 2001 From: Rosalyn Tan Date: Thu, 8 Oct 2020 14:09:08 -0700 Subject: [PATCH] Allow Generic OAuth for Facebook and Apple when using the auth emulator. (#6702) --- .../Sources/AuthProvider/OAuth/FIROAuthProvider.m | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/FirebaseAuth/Sources/AuthProvider/OAuth/FIROAuthProvider.m b/FirebaseAuth/Sources/AuthProvider/OAuth/FIROAuthProvider.m index b011eed29a..a0290fda72 100644 --- a/FirebaseAuth/Sources/AuthProvider/OAuth/FIROAuthProvider.m +++ b/FirebaseAuth/Sources/AuthProvider/OAuth/FIROAuthProvider.m @@ -203,12 +203,14 @@ static NSString *const kCustomUrlSchemePrefix = @"app-"; @return An Instance of @c FIROAuthProvider. */ - (nullable instancetype)initWithProviderID:(NSString *)providerID auth:(FIRAuth *)auth { - NSAssert(![providerID isEqual:FIRFacebookAuthProviderID], - @"Sign in with Facebook is not supported via generic IDP; the Facebook TOS " - "dictate that you must use the Facebook iOS SDK for Facebook login."); - NSAssert(![providerID isEqual:@"apple.com"], - @"Sign in with Apple is not supported via generic IDP; You must use the Apple iOS SDK" - " for Sign in with Apple."); + if (!auth.requestConfiguration.emulatorHostAndPort) { + NSAssert(![providerID isEqual:FIRFacebookAuthProviderID], + @"Sign in with Facebook is not supported via generic IDP; the Facebook TOS " + "dictate that you must use the Facebook iOS SDK for Facebook login."); + NSAssert(![providerID isEqual:@"apple.com"], + @"Sign in with Apple is not supported via generic IDP; You must use the Apple iOS SDK" + " for Sign in with Apple."); + } self = [super init]; if (self) { _auth = auth;