Auth flow
Credentials entered
The user enters a username and password on
LoginScreen. The credentials are trimmed and validated before the task is started.Server resolved
GTV_ResolveServerForAuth() probes the server list in order — LAN servers first, then the public WAN server — and returns the first server that responds to a health ping.HTTP request sent
AuthTask makes a GET request to the auth endpoint with URL-encoded credentials:TIMEOUT_AUTH = 15000ms.Response parsed
On a successful HTTP response the body is cleaned with
GTV_CleanJson() and parsed. The task checks subscriberStatus, subscriber_active, and active fields to confirm the account is active.Endpoint
AppConstants.brs as:
Auto-login
After the splash screen,MainScene checks the Roku registry for saved credentials:
"GlobalTV" registry section under keys "username" and "password":
Session re-authentication
After a successful auth,MainScene starts a repeating timer that re-authenticates in the background every 7 minutes (420,000 ms):
Session checks are skipped when the device is offline (
m.global.hasInternet = false) or when another auth, playlist, or handshake task is already in flight.Error classification
GTV_AuthClassifyFailure() maps HTTP codes and response body signals to a typed reason code:
Reason codes
| Constant | Value | Meaning |
|---|---|---|
AUTH_REASON_NONE | 0 | Authentication succeeded |
AUTH_REASON_NETWORK_DOWN | 460 | HTTP code -1 — server unreachable or timed out |
AUTH_REASON_CREDENTIALS | 401 | Wrong username or password (HTTP 401/403/404 or credential keywords in body) |
AUTH_REASON_INACTIVE | 470 | Account is inactive (subscriberStatus=false or inactive keywords) |
AUTH_REASON_PASSWORD_CHANGED | 471 | Password was changed since the session started |
Classification logic
AUTH_REASON_NETWORK_DOWN (460)
AUTH_REASON_NETWORK_DOWN (460)
Returned when
httpCode = -1, which means the HTTP client timed out or could not reach the server. The timeout is TIMEOUT_AUTH = 15000ms.AUTH_REASON_INACTIVE (470)
AUTH_REASON_INACTIVE (470)
Triggered when
subscriberActive = false is passed explicitly, or when the normalized signal string contains any of: user_inactive, subscriberstatus, subscriberdisabledreason, inactivo, inactive, cuenta inactiva, subscriber inactive.AUTH_REASON_CREDENTIALS (401)
AUTH_REASON_CREDENTIALS (401)
Triggered by HTTP 401, 403, or 404, or when the body contains credential failure keywords such as
credenciales incorrectas, invalid credentials, wrong credentials, username or password, etc.AUTH_REASON_PASSWORD_CHANGED (471)
AUTH_REASON_PASSWORD_CHANGED (471)
Triggered when the body contains an explicit phrase like
password changed, contrasena cambio, or a combination of password + change/reset keywords, or revoked session signals like token revoked, session expired, unauthenticated.AuthTask interface
Defined inAuthTask.xml:
| Field | Type | Direction | Description |
|---|---|---|---|
username | string | input | The username to authenticate |
password | string | input | The password to authenticate |
result | assocarray | output | Auth result object (see below) |
done | boolean | output | Set to true when the task completes |
statusMessage | string | output | Human-readable status for UI display |
statusTick | integer | output | Increments on each status update |