Authentication for MSK assessment routes opened through the GOFA WebView SDK.
This document describes how authentication works for MSK (Musculoskeletal) Assessment routes when using the GOFA WebView SDK.
As of February 2026, MSK routes use Firebase custom token authentication instead of HTTP basic auth. This change provides per-client access control via subdomain-based validation.
MSK routes (/msk/*) are protected by Firebase authentication. The Flutter WebView SDK obtains a Firebase custom token, passes it via URL parameter, and the server automatically exchanges it for a session cookie on first load. Subsequent navigations use that session cookie — no further token passing is needed.
sequenceDiagram
participant App as Your Flutter App
participant SDK as GOFA WebView SDK
participant Server as GOFA Server
Note over App: 1. SDK initialization
App->>SDK: init(clientId, clientSecret, clientUserId)
SDK->>Server: Request custom token
Server-->>SDK: Firebase custom token
Note over App: 2. Open WebView
SDK->>Server: GET /msk/home?customToken=xxx&locale=en
Server-->>SDK: Page loads, auto sign-in, session cookie set
Note over SDK: customToken stripped from URL
Note over App: 3. Subsequent navigations
SDK->>Server: GET /msk/assessment/123 (session cookie)
Server-->>SDK: 200 OK (authenticated)clientId, clientSecret, and clientUserIdhttps://{clientId}.gofa.app/msk/home?customToken=xxx&locale=enMSK URLs are scoped by client subdomain: https://{clientId}.gofa.app/msk/*
The server validates that the authenticated user's token matches the subdomain they are accessing. If there's a mismatch, the user is signed out and redirected.
| Scenario | Result |
|---|---|
| Token matches subdomain client | Access granted |
| Token does not match subdomain | Signed out, redirected |
| No session / expired session | Redirected to sign in |
First visit with ?customToken | Auto sign-in, session created |
?customToken parameter is only used on the first page load and is immediately removed from the URLLegacy basic auth support is temporary and will be removed in a future release.
Older Flutter SDK versions used HTTP basic auth for MSK routes. During the transition period, the server can optionally accept basic auth for backward compatibility. Contact your GOFA representative if you need this enabled while migrating.
basicAuthUser and basicAuthPass from your SDK initializationThe Flutter WebView SDK handles authentication automatically:
// 1. Initialize the SDK (generates custom token internally)
final manager = WebViewSdkManager();
await manager.init(
clientId: 'your-client-id',
clientSecret: '<client-secret>',
clientUserId: '<gofa-user-id>',
environment: Environment.PRD,
);
// 2. Open the WebView (customToken added to URL automatically)
Navigator.push(
context,
MaterialPageRoute(
builder: (_) => WebviewScreen(
url: 'https://your-client.gofa.app/msk/home',
customToken: manager.customToken,
locale: const Locale('en'),
),
),
);The basicAuthUser and basicAuthPass parameters on WebViewSdkManager are deprecated as of gofa_webview v1.1.0. You can safely remove them from your code.
| Date | Change |
|---|---|
| 2026-02-11 | Initial version. Documented Firebase custom token auth flow replacing HTTP Basic Auth. |