Verifies if the web authentication flow is available on the current device.
Android: Returns true if the user's device has Google Chrome installed, enabled, and supports
Google Chrome Auth Tabs,
which are required to perform the authentication flow.
iOS: Always returns false as web auth flow is not supported on iOS.
A boolean value indicating whether the web auth flow is available on the user's device.
Successful execution of this method is dependent on the package_name and sha256_cert_fingerprints values present in the target domain's
assetlinks.json
matching those belonging to your app.
For testing, running adb shell pm set-app-links --package [PACKAGE_NAME] 2 all temporarily
bypasses those requirements.
Starts a web-based authentication flow, opening the start URL in a secure browser tab.
The flow completes when the browser redirects to the callback path on the host domain.
Platform availability: Android only. On iOS, this method throws an error. Always check isAvailable before calling this method.
Example:
const modules = await Eitri.modules();
const isAvailable = modules?.webAuth?.isAvailable;
if (!isAvailable) {
console.log("Web auth flow is not available on this device.")
return
}
const available = await isAvailable()
if (!available) {
console.log("Web auth flow is not available on this device.")
return
}
const startAuthFlow = modules?.webAuth?.startAuthFlow;
if (!startAuthFlow) return;
const result = await startAuthFlow({
startUrl: "https://www.example.com/oauth/authorize?client_id=abc&redirect_uri=...",
redirectHost: "www.example.com",
redirectPath: "/oauth/callback"
})
Object with startUrl,
redirectHost, and
redirectPath attributes.
Object with the authUrl attribute,
containing the full redirect URL captured when the auth flow completes.
Generic web authentication flow service. Launches a browser-based auth flow using Chrome Auth Tabs and captures the redirect URL.
This service provides a generic mechanism for performing web-based authentication flows. It opens a start URL in a secure browser tab, monitors for a redirect to a callback path on the specified host domain, and returns the full redirect URL (including any auth tokens or codes as query parameters).
Requirements: This feature must be enabled in the Eitri Shopping App native configuration by setting
useWebAuthService: truein the app configuration file.Platform availability: Android only. On iOS, isAvailable always returns
false.