Skip to content

Commit 393d060

Browse files
Raise exception when log into Facebook using OAuth. (#3138)
Raise exception when log into Facebook using OAuth. Facebook requires use of its official SDK for mobile and doesn't allow web based flows.
1 parent 64ddd88 commit 393d060

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Firebase/Auth/Source/AuthProvider/OAuth/FIROAuthProvider.m

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,11 @@
2323
#import "FIRAuthBackend.h"
2424
#import "FIRAuth_Internal.h"
2525
#import "FIRAuthErrorUtils.h"
26+
#import "FIRAuthExceptionUtils.h"
2627
#import "FIRAuthGlobalWorkQueue.h"
2728
#import "FIRAuthRequestConfiguration.h"
2829
#import "FIRAuthWebUtils.h"
30+
#import "FIRFacebookAuthProvider.h"
2931
#import "FIROAuthCredential_Internal.h"
3032
#import "FIROAuthCredential.h"
3133

@@ -165,6 +167,12 @@ - (void)getCredentialWithUIDelegate:(nullable id<FIRAuthUIDelegate>)UIDelegate
165167
@return An Instance of @c FIROAuthProvider.
166168
*/
167169
- (nullable instancetype)initWithProviderID:(NSString *)providerID auth:(FIRAuth *)auth {
170+
if ([providerID isEqual:FIRFacebookAuthProviderID]) {
171+
[FIRAuthExceptionUtils raiseInvalidParameterExceptionWithReason:
172+
@"Sign in with Facebook is not supported via this method; the Facebook TOS "
173+
"dictate that you must use the Facebook iOS SDK for Facebook login."];
174+
return nil;
175+
}
168176
self = [super init];
169177
if (self) {
170178
_auth = auth;

0 commit comments

Comments
 (0)