Interface OidcBrowserNative
Service-provider interface that SystemBrowser uses to dispatch a sign-in
flow through the OS's hardened sign-in surface
(ASWebAuthenticationSession on iOS, androidx.browser.customtabs /
Credential Manager on Android).
The platform port supplies an implementation named
com.codename1.io.oidc.OidcBrowserNativeImpl; SystemBrowser loads it via
Class.forName at first use. Cn1lib authors who want to plug in their own
implementation (for example, one backed by a NativeInterface
so a 3rd-party SDK can drive the browser) can declare a subtype and
register it with
invalid reference
SystemBrowser#setNative(OidcBrowserNative)
no need to extend NativeInterface from this interface itself.
redirectScheme is the scheme half of the registered redirect URI (e.g.
the "com.example.app" part of "com.example.app:/oauth2redirect").
- Since:
- 7.0.245
-
Method Summary
Modifier and TypeMethodDescriptionbooleantrueif this implementation is usable on the current device / OS version.startAuthorization(String authUrl, String redirectScheme) Starts the OS sign-in sheet forauthUrland resolves when the user is redirected to a URL matchingredirectScheme.
-
Method Details
-
isSupported
boolean isSupported()trueif this implementation is usable on the current device / OS version. The default fallback (SystemBrowser's in-appBrowserWindow) takes over when this returnsfalse, so a port that has a class on the file system but cannot satisfy the runtime requirements (e.g. iOS 11 lacksASWebAuthenticationSession) should reportfalseand the call will degrade gracefully. -
startAuthorization
Starts the OS sign-in sheet for
authUrland resolves when the user is redirected to a URL matchingredirectScheme. The return value is the full redirect URL (including query / fragment), ornullif the user cancelled.Implementations are expected to be blocking: the caller is on a worker thread and waits for the result.
-