Comments (10)
if the app terminates, then the UI is getting presented. so, it seems it's only cached while the app is running in the foreground and background, but once the app is closed, then it will present the UI again for the user to choose the google account to login with. so, this is a 2nd problem.
so, for the first problem, we store on the device's user prefs that the user has a google account used before.
but, for the the 2nd issue stated in this comment, how do i cache the tokens and check for valid without going to the UI again for the user to choose their account again? this is the experience i am seeing when using googleApi.authenticate()
from simple_auth.
I cannot duplicate this. Using the sample, on iOS and Android if I log into an account. next time I press login the UI is not shown. What platform are you trying this on? iOS Simulator has had a bug for years, if you don't specify entitlements it will not let you securely save tokens. So this could happen on the iOS Simulator.
from simple_auth.
from simple_auth.
I have been debugging. Starting and stoping the debugger. That kills the processes
from simple_auth.
If you look at the authenticate code, it loads the cached account. If it is still valid, it returns and never presents the UI: https://github.com/Clancey/simple_auth/blob/master/simple_auth/lib/src/oauth/oauthApi.dart#L60-L72
from simple_auth.
I would recommend cloning the source, putting some breakpoints in there and see what happens for you.
from simple_auth.
from simple_auth.
@Clancey you're right about that example performing as i'm looking for. i don't know what i'm doing wrong.
from simple_auth.
What provider are you using? A custom one? If so, it is most likely not setting the RefreshToken or the Expiration on the account.
from simple_auth.
sorry, i don't understand to answer that. but, i did want to report back in case someone encounters this problem as well. for me, it was a scope issue of where this instance was declared:
final simpleAuth.GoogleApi googleApi = new simpleAuth.GoogleApi(,,,
when i relocated it to the same function where the below statement happens, then it was working as the example, giving the desired result. i think i'm fine with the result of the code on this, so i will not be investigating why for now.
var user = await googleApi.getUserProfile();
from simple_auth.
Related Issues (20)
- Documentation lacks information HOT 1
- iOS build issue
- Incompatible with http 0.13.0 HOT 5
- Flutter 2.0 - Dependency compatibility issue HOT 2
- Error in new simple_auth 2.0.10 HOT 2
- Redirection Issue for Instagram Login HOT 2
- Authenticator doesn't cancel after dismissing on iOS and macOS HOT 1
- redirect from facebook not being catched HOT 1
- Github login with Flutter web HOT 2
- The plugin `simple_auth_flutter` uses a deprecated version of the Android embedding. HOT 2
- Bad state: Future already completed - Google Sign In on Mac
- Kindly add support for digest authentication and also share example that how to use digest authentication.
- [Fix] exported in Android 12
- Apple support HOT 4
- Custom tabs closes when putting the app on background or switching task HOT 2
- Can I use this library in a Flutter app for web only ?
- Windows Desktop
- After Instagram Login redirect to webview
- Upgrade http module
- Chrome tabs remain open after redirect back to app
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from simple_auth.