AiinCallbackServer class final
Loopback HTTP server catching the AIIN OAuth redirect.
Dual-stack on the loopback interface (gh-1044 review): the primary
IPv4 listener plus a best-effort IPv6 listener on the same port, so
the fallback leg (an in-sheet redirect that loads the server for
real) is reachable no matter how the client resolves the host — a
localhost label may answer ::1, and the literal 127.0.0.1 needs
the IPv4 listener. The IPv6 listener is optional: hosts without IPv6
loopback skip it (debugPrint) and the flow keeps working over IPv4.
Constructors
Properties
- callbackHost ↔ String
-
The host the callback URL advertises. The flow advertises the
literal
127.0.0.1on every surface (scheme interception ignores the host; the fallback leg needs an address that reaches the IPv4 bind without resolver ambiguity); other values only for tests.getter/setter pair - callbackUrl → String?
-
The redirect URI to register with initiateAiinOAuth
(
http://<host>:<ephemeral-port>/callback).no setter - hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
close(
) → Future< void> -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
start(
{Duration timeout = const Duration(minutes: 5), String callbackHost = '127.0.0.1'}) → Future< String> - Binds the loopback server and returns the redirect URI.
-
toString(
) → String -
A string representation of this object.
inherited
-
waitForCallback(
) → Future< AiinCallback?>
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited