Skip to content

0.3.0

Choose a tag to compare

@github-actions github-actions released this 02 Nov 15:03
· 6 commits to main since this release
652a624

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-android now contains what oauth-core, dpop-android, storage-android, browser-android and okhttp-android contained, 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, other acr_values) is still refused with Configuration.
  • Every error has a stable code, independent of its payload, for logging and branching without toString(): code on Kotlin and Swift, sdkCode on Dart (the Dart ConfigurationError.code already carries the provider's OAuth error). The list is in spec/errors.md.
  • Test your code against an interface. OAuthApi on every platform (a Kotlin interface, a Swift protocol, a Dart interface) is what OAuthClient implements; 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 a debug level (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.create with a different httpClient or logger for the same client is refused with Configuration, instead of silently returning the first client and ignoring the new one.

Fixes

  • Protocol: DPoP is used only when ES256 is advertised; nbf is checked; token_type must be Bearer or DPoP; expires_in is read leniently; the DPoP clock offset is kept per origin and the server's Date is believed only near the device clock; discovery falls back to the RFC 8414 address; the key set is cached per jwks_uri; a redirect to another URI is a malformed response; iOS checks the iss and aud of 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_hint reaches no other app; 10.0.2.2 is no longer treated as loopback (a cleartext issuer is accepted on localhost, 127.0.0.1 and [::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 an OAuthError.

Upgrading

  • Android: an app that declares one of the five old artifacts must remove that line. oauth-core, dpop-android, storage-android, browser-android or okhttp-android at 0.2.0 or earlier next to oauth-android:0.3.0 brings a second copy of the classes and fails the build with a duplicate-class error. An app that depends on oauth-android alone needs no change.
  • Android: OAuthClient.interceptor() and Versola.interceptor() are gone. An application interceptor sits above OkHttp's redirect handling, so on a client that follows redirects the DPoP header was sent to the redirect target. Use authenticatedClient(), httpClient() or call(), which turn redirects off. VersolaInterceptor, RequestScope and the wiring classes are behind the @VersolaInternalApi opt-in.
  • Android: binary compatibility. login, logout and stepUp take their default arguments from OAuthApi, so a library compiled against 0.2.0 that calls the static OAuthClient.login$default needs 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:) is dpop(requireHardware:), as on Android; OAuthConfiguration.storageKey, fingerprint and toMetadata() are no longer public.
  • iOS: a stored grant whose DPoP key is gone ends in Reauthenticate(CredentialsInvalidated). A locked device stays unlockRequired and is not signed out.
  • Flutter: OAuthClient is an interface (OAuthClient.create is unchanged); OAuthConfiguration and LoginOptions are no longer const (drop const at the call site); create no longer takes a host parameter; a duration the bridge would truncate is an ArgumentError; create throws UnsupportedError off Android and iOS. The Dart changelog has the rest.
  • Exhaustive when and switch: none of the error categories changed; code and sdkCode are 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