Interface IPProtectionController.AuthProvider

Enclosing class:
IPProtectionController

public static interface IPProtectionController.AuthProvider
Embedder-provided hooks for authentication.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns a fresh authentication token.
  • Method Details

    • getToken

      @UiThread @NonNull default GeckoResult<String> getToken()
      Returns a fresh authentication token. Called for every Guardian API request; the implementer is responsible for caching and refreshing.

      The token must have the "https://identity.mozilla.com/apps/vpn" scope.

      To signal that no token is available, return a GeckoResult that rejects (e.g. GeckoResult.fromException(Throwable)) or resolves to null or an empty string. In all of those cases the in-flight Guardian request will fail with "no-token".

      Returns:
      A GeckoResult that resolves to a non-empty token string.