rekire / autologin_plugin Goto Github PK
View Code? Open in Web Editor NEWAutologin plugin for Flutter
License: MIT License
Autologin plugin for Flutter
License: MIT License
With so called federated plugins you can add optional more platforms like the web (see also #6). This seems to be easy to implement, based on the path_provider
plugin.
For Windows the Windows Vault credential manager could be used. There are two methods CredWrite()
and CredRead()
which seems to be easy to use based on this Stack Overflow answer.
I'll check if I can implement this.
MissingPluginException: MissingPluginException(No implementation found for method disableAutoLogIn on channel autologin_plugin)
File "platform_channel.dart", line 165, in MethodChannel._invokeMethod
File "<asynchronous suspension>"
File "autologin_plugin.dart", line 31, in AutologinPlugin.disableAutoLogIn
File "<asynchronous suspension>"
File "future.dart", in Future.wait.<fn>
In my opinion, using exceptions for saying that the user has no saved credentials is pretty bad design. It's common to use null
for this case. This won't let my error reporting tool freak out.
Another idea is a isSupported
method to prevent an exception raised because of a not existing Google API. This would also be very helpful with different platforms.
I think the best way to integrate is to use libsecret. KDE and GNOME seem to use it.
flutter_secure_storage
seems to use it too.
I don't know the reason for the crash, but it crashed multiple times by clicking on the button for not selecting an email address from the list and once after clicking on the save button I added in #1.
E/AndroidRuntime( 8501): FATAL EXCEPTION: main
E/AndroidRuntime( 8501): Process: de.wbtsolutions.openproject_app, PID: 8501
E/AndroidRuntime( 8501): java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=48233, result=-1, data=null} to activity {de.wbtsolutions.openproject_app/de.wbtsolutions.openproject_app.MainActivity}: java.util.ConcurrentModificationException
E/AndroidRuntime( 8501): at android.app.ActivityThread.deliverResults(ActivityThread.java:4845)
E/AndroidRuntime( 8501): at android.app.ActivityThread.handleSendResult(ActivityThread.java:4886)
E/AndroidRuntime( 8501): at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:51)
E/AndroidRuntime( 8501): at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
E/AndroidRuntime( 8501): at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
E/AndroidRuntime( 8501): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016)
E/AndroidRuntime( 8501): at android.os.Handler.dispatchMessage(Handler.java:107)
E/AndroidRuntime( 8501): at android.os.Looper.loop(Looper.java:214)
E/AndroidRuntime( 8501): at android.app.ActivityThread.main(ActivityThread.java:7356)
E/AndroidRuntime( 8501): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime( 8501): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
E/AndroidRuntime( 8501): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
E/AndroidRuntime( 8501): Caused by: java.util.ConcurrentModificationException
E/AndroidRuntime( 8501): at java.util.HashMap$HashIterator.nextNode(HashMap.java:1441)
E/AndroidRuntime( 8501): at java.util.HashMap$KeyIterator.next(HashMap.java:1465)
E/AndroidRuntime( 8501): at io.flutter.embedding.engine.FlutterEnginePluginRegistry$FlutterEngineActivityPluginBinding.onActivityResult(FlutterEnginePluginRegistry.java:689)
E/AndroidRuntime( 8501): at io.flutter.embedding.engine.FlutterEnginePluginRegistry.onActivityResult(FlutterEnginePluginRegistry.java:378)
E/AndroidRuntime( 8501): at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.onActivityResult(FlutterActivityAndFragmentDelegate.java:597)
E/AndroidRuntime( 8501): at io.flutter.embedding.android.FlutterFragment.onActivityResult(FlutterFragment.java:699)
E/AndroidRuntime( 8501): at io.flutter.embedding.android.FlutterFragmentActivity.onActivityResult(FlutterFragmentActivity.java:510)
E/AndroidRuntime( 8501): at android.app.Activity.dispatchActivityResult(Activity.java:8110)
E/AndroidRuntime( 8501): at android.app.ActivityThread.deliverResults(ActivityThread.java:4838)
E/AndroidRuntime( 8501): ... 11 more
I/Process ( 8501): Sending signal. PID: 8501 SIG: 9
The Keychain Service can be used on MacOS.
Tutorials for storing and searching keychain items.
(I'm adding this just for completeness)
For Apple devices the Safari AutoFill
should be added.
API documentation is here: https://developer.apple.com/documentation/security/1617896-secrequestsharedwebcredential
If I'm signed in with multiple Google accounts on my device I would like to have the possibility to save for example my works login under the works account and my private ones under my private account.
Referring to this https://developers.google.com/android/reference/com/google/android/gms/auth/api/credentials/package-summary, there seem to be setAccountName
for archiving this. There would be also a method needed to get all available accounts to let the user choose the preferred one
There is an experimental web api for storing credentials:
https://developer.mozilla.org/en-US/docs/Web/API/Credential_Management_API
For the best login experience it should be as simple as possible to get the user signed in (again) and in best case with zero touch.
Should allow using login data from other devices or the browser. On Android OneTap or the CredeitialManager API #20 the should be used. For iOS I plan to use shared web credentials as mentioned in #11. Both APIs should provide a simple way to access the credentials. On the other hand both APIs have a hard requirement to prove the connection between the APP and the website. On Android assetlinks are required while for Apple associated Domains are required. The documentation need to explain the steps which are required for this.
Should allow the user to fetch some session data to recover the account. For Android I want to use BlockStore. On iOS I want simply to read out the keychain might be with secure storage which is already syncing their data with the keychain.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.