Package io.karatelabs.http
Interface OAuth2BrowserCallback
public interface OAuth2BrowserCallback
Callback interface for OAuth 2.0 browser-based authorization.
Implementations can use JavaFX WebView, system browser, CDP, etc.
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidcancel()Optional: Cancel ongoing authorizationopenBrowserForAuthorization(String authorizationUrl, String redirectUri) Open browser for user authorization.
-
Method Details
-
openBrowserForAuthorization
Open browser for user authorization. The implementation should: 1. Open the authorization URL in a browser (WebView, system browser, etc.) 2. Wait for the OAuth provider to redirect to redirectUri 3. Extract the authorization code from the redirect 4. Complete the future with the code- Parameters:
authorizationUrl- Full authorization URL with all query parametersredirectUri- The redirect URI that will receive the authorization code- Returns:
- CompletableFuture that completes with authorization code or error
-
cancel
default void cancel()Optional: Cancel ongoing authorization
-