简体   繁体   中英

Is email required for Firebase Authentication?

I'm making a tiny app for a few people. Since they all have iPhones and I need some low-key user management, I'm going to use Firebase. It has a really easy-to-use implementation of "Sign in with Apple", which is just what I need.

As far as I can tell, "Sign in with Apple" natively lets you specify requested scopes like this (when implementing it yourself):

request.requestedScopes = [.fullName, .email]

But I don't need their email. I just want a unique user (by some hidden ID), and their name (not necessarily unique).

When using Firebase, following this guide , I don't have access to the "request" or its scope, and it seems like email is requested by default. Is .email required for Firebase in this case? It seems so, as when using it now, I see that the user email is used as "Identifier" in the user list in the Firebase Authentication console.

If so, it's not a deal-breaker for me (though I'm sure it is for some), but it does feel "iffy" requesting their e-mail adresses for literally nothing.

Is it possible to use "Sign in with Apple" in Firebase without requesting the users email?

After going into the FirebaseUI-files (from CocoaPods) and changing a few fields, it does work perfectly without email. The users simply show up with "-" as identifier in the console.

The only file I needed to change was FUIOAuth.m , by removing the scope "email" from lines :195 and :245 . This is obviously a terrible idea. Never edit pods. But now I know that it is possible. I could download the framework as a zip and do my changes there if I really want the FirebaseUI, or I can just ditch the entire FirebaseUI and create my own UI and implement it without the email-scope.

If only they could expose the scopes so I didn't have to do either of these..

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM