UflowOAuth class
OAuth flow matching cloud_uflow's /oauth/token Supports:
- authorization_code with PKCE (public clients: mobile, SPA)
- authorization_code with API key (confidential clients: server)
- refresh_token
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
clearTokens(
) → Future< void> - Clear tokens (sign out from Cloud OAuth)
-
exchangeCode(
{required String code, required String clientId, required String redirectUri, String? codeVerifier, String? apiKey}) → Future< UflowTokenResponse> - Exchange code for tokens For public clients: provide codeVerifier (the original verifier, SDK will hash to S256) For confidential clients: provide apiKey (uf_live_...) as Bearer in header
-
loadTokens(
) → Future< UflowTokenResponse?> - Load tokens from storage
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
refresh(
{required String refreshToken, required String clientId}) → Future< UflowTokenResponse> - Refresh access token
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
parseCallback(
String url) → Map< String, String> - Parse redirect URI that contains ?code=&state= Example: https://myapp.com/callback?code=AbC123&state=xyz or custom scheme: com.modder.widgets://oauth?code=...&state=...
Constants
- instance → const UflowOAuth