OpenAiAuthService class
OAuth 2.0 Device Code flow for OpenAI ("Sign in with ChatGPT").
Implements the same flow as codex login --device-auth:
- Request a device code + user code
- User visits verification URL and enters the code
- App polls until authorization is complete
- Exchange authorization code for tokens via PKCE
Constructors
- OpenAiAuthService(FlutterSecureStorage _storage, [Dio? dio])
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
-
getAccessToken(
) → Future< String> -
getUserEmail(
) → Future< String?> - The signed-in user's email (if available).
-
isSignedIn(
) → Future< bool> - Whether the user has a usable session.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
pollForCompletion(
DeviceCodeChallenge challenge) → Future< void> -
requestDeviceCode(
) → Future< DeviceCodeChallenge> -
signOut(
) → Future< void> -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited