I've been working on Authyra for a while, mostly because I wasn't happy with how session management was handled in some of my Flutter projects.
If your app talks to its own backend using access and refresh tokens, you've probably written some kind of refresh interceptor yourself.
That usually works fine until a few things happen:
I've run into these kinds of problems enough times that I decided to work on a separate session layer instead of implementing the same logic in every project.
A few things I've been focusing on:
AuthStateBuilder.The core is pure Dart. Flutter and Dio integrations are separate, and there are also integrations for Google, Apple, OAuth 2.0 with PKCE and backend-driven OAuth.
One thing worth clarifying: Authyra isn't an identity provider, and it's not meant to replace Firebase Auth or Supabase Auth. It's for applications where you already have your own backend issuing tokens.
I also put together a small Flutter web demo to reproduce one of these problems. It simulates the backend and network, so you can sign in, send 20 requests with a naive refresh implementation, and compare the behavior with Authyra.
The user has developed a session management layer called Authyra for Flutter apps with custom backends, addressing common issues with token refresh logic. They highlight features like single refresh operations, secure storage, and multiple session handling. The user seeks feedback on API design and edge cases.
It's currently at 0.3.0, first public release, MIT licensed.
I'd be interested in feedback, especially around the API design and edge cases I might have missed. Also curious how others handle refresh token rotation and concurrent requests in their own Flutter apps.