GoogleTilesAuthProvider

Google Photorealistic 3D Tiles auth. Static ?key=<apiKey> on every request; the ?session=<token> from the root response is propagated down the tree.

Constructors

Link copied to clipboard
constructor(apiKey: String)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
open override val discriminator: String

Hard-coded identifier used as the discriminator when serializing the provider via Ogc3dAuthCredentials; must survive R8 / ProGuard / Kotlin-Native obfuscation.

Link copied to clipboard
open override val hasRefreshableSession: Boolean

Session tokens are minted per root fetch, so re-bootstrapping can cure a rejection.

Functions

Link copied to clipboard
open override fun invalidateSessionState()

Drop the cached session so the next root fetch is forced to bootstrap a fresh one. Called by the fetch queue after a content 401/403 — Google's session tokens are long-lived but not eternal, and on expiry every tile URL minted under the old session is dead.

Link copied to clipboard
open override fun isAuthRejection(statusCode: Int): Boolean

Google answers an expired/mismatched session= with HTTP 400, not 401/403, so fold it in — otherwise a timed-out session never triggers recovery.

Link copied to clipboard

Whether a successful tileset.json body for url should be persisted to the blob cache. Providers whose first response is a redirect envelope rather than a real tileset (Cesium Ion's /endpoint returns {type, url, accessToken}) return false so it never gets cached as if it were tileset content. Default true — root and subtree tileset.json bodies cache normally and replay across sessions, with the embedded session/auth tokens reused as long as the server still accepts them.

Link copied to clipboard
open override fun observeTilesetResponse(requestedUrl: String, responseUrl: String, body: String)

Inspect a successful tileset.json fetch result so the provider can update its internal state from the response (e.g. Google's session query parameter on the response URL, Cesium Ion's asset endpoint URL + access token in the response body). Default no-op.

Link copied to clipboard
open fun redirectFor(responseUrl: String, body: String): String?

Ask the provider whether a successful tileset fetch should redirect to a different URL. Returns the new URL when the response is itself a redirect envelope (e.g. Cesium Ion's api.cesium.com/v1/assets/<id>/endpoint returns JSON with url + accessToken fields; the actual tileset.json lives at the returned URL), or null when body is the final tileset.json content.

Link copied to clipboard
open override fun rewriteChildUri(parentUri: String, childUri: String): String

Rewrite a child URI discovered while parsing a tileset. Lets providers propagate persistent query parameters (Google's session token) onto every child URI as soon as the tree is built, instead of waiting until each child fetch fires. Default returns the URI unchanged.

Link copied to clipboard
open override fun rewriteRequest(url: String, headers: MutableMap<String, String> = mutableMapOf()): AuthedRequest

Rewrite an outgoing request. Called once per HTTP fetch immediately before the GET. Implementations may mutate the URL (e.g. append a token) and/or supply extra headers. Returning the input unchanged is fine — see NoAuthProvider.