Troubleshooting
Users get signed out unexpectedly
- Your refresh callback treats temporary errors as revocations. Throw
RefreshRevokedExceptiononly on 401 orinvalid_grant. Let timeouts and 5xx propagate as they are. - Your server returns 401 for temporary problems on the refresh endpoint. See Backend requirements.
- Another client uses the same refresh token: a second app instance, an extension, or code that refreshes without going through
accessToken().
Listen to SessionEndedEvent and log its reason to tell these apart.
The sign-in screen flashes at launch
The UI renders AuthUnknown like AuthSignedOut. Show a splash for AuthUnknown, or keep the native splash until Authyra.initialize returns.
Requests loop or hang on 401
The Dio your provider uses for /auth/refresh carries AuthyraInterceptor. Use a separate instance for auth calls.
AuthConfigException: ... start()
Authyra was used before start() completed. Await Authyra.initialize(...), or start() on an instance you built.
macOS: keychain errors
Add the Keychain Sharing capability to the macOS runner (keychain-access-groups entitlement), as flutter_secure_storage requires.
Google returns no ID token on Android
Set serverClientId to your OAuth client of type "Web application".
OAuth sign-in never returns on Android
The callback activity for your redirect scheme is missing from AndroidManifest.xml. See the flutter_web_auth_2 setup.
A reinstalled iOS app is still signed in
Keychain items survive uninstall. Clear Authyra's keys on first launch: see Storage.
Logs
Authyra logs through package:logging under the authyra logger names, without token values:
Logger.root.level = Level.FINE;
Logger.root.onRecord.listen((record) => debugPrint('${record.loggerName}: ${record.message}'));