Repository navigation
0.3.0
Versola OAuth SDK 0.3.0
The Android SDK is now one Maven artifact, the 2026-11-01 audit of the SDK is fixed on Android, iOS and Flutter (protocol conformance, session lifecycle, secret handling, error taxonomy), a repeated login() no longer fails, and every error carries a stable code. The API is still pre-1.0: some public API changed on the way, and the list is in "Upgrading" below.
What's new
- Android: one artifact.
io.versola:oauth-androidnow contains whatoauth-core,dpop-android,storage-android,browser-androidandokhttp-androidcontained, and it is the only Android artifact published. Its POM names only third-party libraries. The five others stay on Maven Central at 0.1.0 and 0.2.0 and are not published from this release. - A repeated
login()joins the one in flight. A double-tapped button no longer fails: the second call with the same request awaits the first one's result (one browser, one code exchange). A call that asks for something else (other scopes, otheracr_values) is still refused withConfiguration. - Every error has a stable
code, independent of its payload, for logging and branching withouttoString():codeon Kotlin and Swift,sdkCodeon Dart (the DartConfigurationError.codealready carries the provider's OAuth error). The list is inspec/errors.md. - Test your code against an interface.
OAuthApion every platform (a Kotlin interface, a Swift protocol, a Dart interface) is whatOAuthClientimplements; take it in your code and fake it in tests. The HTTP helpers are not part of it. currentSessionState()on Android (suspend): the state after the restore a cold start owes, for choosing between a sign-in screen and a home screen without collecting a flow. The logger has adebuglevel (a default no-op; it never carries a token, code, state or URL with a query).IOException.versolaError()on Android,stepUp(_ challenge:)on Swift take the error you caught, so the three platforms read the same way.- A non-JSON answer from discovery or the token endpoint (a proxy's error page, a captive portal) is a recoverable network error, not a configuration error. A redirect from these endpoints is still never followed.
- A second
OAuthClient.createwith a differenthttpClientor logger for the same client is refused withConfiguration, instead of silently returning the first client and ignoring the new one.
Fixes
- Protocol: DPoP is used only when
ES256is advertised;nbfis checked;token_typemust beBearerorDPoP;expires_inis read leniently; the DPoP clock offset is kept per origin and the server'sDateis believed only near the device clock; discovery falls back to the RFC 8414 address; the key set is cached perjwks_uri; a redirect to another URI is a malformed response; iOS checks theissandaudof a signed UserInfo response. - Session and lifecycle: a rotated refresh token is no longer lost when the caller is cancelled (Android) or the Keychain is locked (iOS); a logout during a code exchange is no longer undone by the login finishing; logout ends a waiting login and refuses refreshes while it runs; a new login clears the previous grant's rotation slot; the access token's age is measured on a clock that keeps counting in deep sleep (Android);
Versola.configure()with the same configuration returns the same instance. - Secrets and the browser leg: the plain-browser fallback is pinned to a resolved browser package, so an end-session URL with
id_token_hintreaches no other app;10.0.2.2is no longer treated as loopback (a cleartext issuer is accepted onlocalhost,127.0.0.1and[::1]only); query strings stay out of error text. - Flutter: two clients that reach one native client no longer silence each other's
sessionStates(); the stream completes when the native one ends and a failure on it arrives as anOAuthError.
Upgrading
- Android: an app that declares one of the five old artifacts must remove that line.
oauth-core,dpop-android,storage-android,browser-androidorokhttp-androidat 0.2.0 or earlier next tooauth-android:0.3.0brings a second copy of the classes and fails the build with a duplicate-class error. An app that depends onoauth-androidalone needs no change. - Android:
OAuthClient.interceptor()andVersola.interceptor()are gone. An application interceptor sits above OkHttp's redirect handling, so on a client that follows redirects theDPoPheader was sent to the redirect target. UseauthenticatedClient(),httpClient()orcall(), which turn redirects off.VersolaInterceptor,RequestScopeand the wiring classes are behind the@VersolaInternalApiopt-in. - Android: binary compatibility.
login,logoutandstepUptake their default arguments fromOAuthApi, so a library compiled against 0.2.0 that calls the staticOAuthClient.login$defaultneeds a recompile. Source code is unaffected. - Android,
OnAppUnlock: the unlock-gated Keystore key replaces the ungated one, so a session stored before is unreadable and the user signs in once more. - iOS:
TokenBinding.dpop(required:)isdpop(requireHardware:), as on Android;OAuthConfiguration.storageKey,fingerprintandtoMetadata()are no longer public. - iOS: a stored grant whose DPoP key is gone ends in
Reauthenticate(CredentialsInvalidated). A locked device staysunlockRequiredand is not signed out. - Flutter:
OAuthClientis an interface (OAuthClient.createis unchanged);OAuthConfigurationandLoginOptionsare no longerconst(dropconstat the call site);createno longer takes ahostparameter; a duration the bridge would truncate is anArgumentError;createthrowsUnsupportedErroroff Android and iOS. The Dart changelog has the rest. - Exhaustive
whenandswitch: none of the error categories changed;codeandsdkCodeare additions.
Requirements
Android minSdk 26 and compileSdk 37 (OkHttp's requirement); iOS 17.4; Flutter 3.47.x and Dart 3.13.x.
Status
The API is pre-1.0. Interface changes happen only when a change is required, and suggestions are welcome as issues.
Full changelog: 0.2.0...0.3.0