-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Firebase plugins (FlutterFire) support #353
Comments
@wiertel |
@HakkyuKim native webview does not cooperate with google oauth - flutter-tizen/plugins#390 |
I successfully logged in to google oauth with ewk_webview_flutter. Now Ill look into how to extract the token from webview. |
Current state is the following: Logging into Firebase seems to work. I added it ad-hoc in the example app. Now I'll be working on merging it into the plugin itself.
EDIT: |
google_sign_in_tizen introduces an interface to obtain an OAuth token from Google API. As the docs state, it is required to use a private key for the sake of authentication. I am currently working on implementing a tizen version of desktop_webview_auth for the firebase auth with implicit flow which does not require sharing a private key and simplifies user interaction. Should I rather use google_sign_in or stick to the current approach? |
@JRazek |
@JRazek I personally prefer google_sign_in_tizen's way in terms of the user interface. If you use a webview for authentication, the user has to enter their account name and password using buttons on a remote control and that's fairly painful. The only concern for me if we decide to use "OAuth 2.0 for TV and Limited-Input Devices" is its limited API scopes. So I think we can support both ways so that developers can choose the best option for their apps. |
At this moment I have a draft of a webview_auth_tizen plugin. I've decided to write a separate plugin instead of porting it because it is much simpler approach. It required no native implementation, just usage of an existing webview plugin. Please let me know if you agree on that approach. |
@JRazek That looks like only a partial solution for your final goal (which is to implement As you can see in the // desktop_webview_auth
final result = await DesktopWebviewAuth.signIn(GoogleSignInArgs(...));
// tizen_webview_auth
final result = await TizenWebviewAuth.signInGoogle(...); You can even add Tizen support to the |
The final app side code will look like this: // If using google_sign_in:
GoogleSignIn googleSignIn = GoogleSignIn(scopes: <String>['email', 'profile']);
GoogleSignInTizen.setCredentials(
clientId: ..,
clientSecret: ..,
);
GoogleSignInAccount googleUser = await googleSignIn.signIn();
GoogleSignInAuthentication result = await googleUser.authentication;
// Alternatively, if using tizen_webview_auth:
AuthResult result = await TizenWebviewAuth.signInGoogle(
clientId: ..,
redirectUri: ..,
scope: 'https://www.googleapis.com/auth/userinfo.email',
));
// Common to all:
OAuthCredential credential = GoogleAuthProvider.credential(
accessToken: result.accessToken,
idToken: result.idToken,
);
UserCredential userCredential = await FirebaseAuth.instance.signInWithCredential(credential); A developer can choose which method to use to sign in. |
I would call it the part of the solution rather than the partial solution. The reason for making the webview_auth_tizen API as a widget is because in original implementation they do not pass the context. There are a few solutions, that I see:
Please tell me which one will suit you best or suggest how would you do it in other way. |
@JRazek The first option makes most sense to me but it's up to your choice. Obviously the third one will require more user code than the others so you will need to provide a "complete" guide on how to use the widget. You also need to clarify how the sign-in screen should be displayed to the end user (e.g. by using |
Most firebase plugins are not yet supported in pure Dart: https://github.com/invertase/flutterfire_desktop. In the meantime, we could use the Firebase C++ SDK if we can build this for Tizen architecture: https://github.com/firebase/firebase-cpp-sdk. I'm first attempting to build for emulator, I'll share any progress worth mentioning here. |
Hi @HakkyuKim, |
Hi, @prasanna-jeyam. I've been moved to a different project starting this year so I'm not working on this issue now. But the last time I checked, The C++ SDK didn't build for X86 (was trying to run on emulators first). I posted an issue here, I think the developer who fixed it afterwards was able to build it, but I remember it didn't work on my machine. For wasn't able to further investigate for arm builds. |
@HakkyuKim When I checked last time (a month ago) the build itself succeeded without error. I haven't checked if the built libraries actually work on Tizen devices though. I think we're going to work on this feature this year but still don't have detailed plans or schedules. /cc @bbrto21 @JSUYA |
|
This issue is a showstopper for us unfortunately as our app heavily uses Firebase. Firestore and Storage in particular. Unfortunately The author of the A merge with A dart implementation of the most used firebase plugins would be prefered but wrapping the C++ SDK is also an option. Unfortunately it is still not recommended to be used outside of development and some features might still be stubs. If Samsung could contact the Google Firebase team on this matter and discuss a collaboration that might help a lot. /cc @marb2000 |
@cbenhagen I am currently trying to support flutter firebase packages based on the There is a limit to extending the Although But as you know, |
@hs0225 thank you so much for working on this! Other platforms could also greatly benefit from this. Especially Linux and Windows. Linking some relevant issues: Also this discussion: |
@hs0225 / @HakkyuKim did you see firebase/flutterfire#10496? |
@cbenhagen Sorry for the late reply. And thanks for your info. I will refer to it for future development. |
The flutterfire_desktop repo has been moved to the FirebaseExtended organization, and according to the recent announcement at Google I/O, there will be more Google support for this project than before. It's still not clear which way (C++ SDK or pure Dart based on REST API) they will eventually go and how much effort they will put into it. |
The FlutterFire Dart SDK is under active development and we may be able to use it in Tizen apps in the near future.
GitHub repo: https://github.com/invertase/flutterfire_desktop
Please check the current status of the packages or even contribute to the project if anyone is interested.
The following libraries are not supported by flutterfire_desktop. They might be implemented using the Firebase C++ SDK instead.
The text was updated successfully, but these errors were encountered: