CallbackProvider mixin

Mixin for auth providers that handle custom callback flows.

Implement this mixin on custom providers (like Telegram) that don't follow standard OAuth or email flows. The handleCallback method will be called by the auth route dispatcher when the callback URL is accessed.

Example

class TelegramProvider extends AuthProvider with CallbackProvider {
  @override
  Future<CallbackResult> handleCallback(
    AuthContext ctx,
    Map<String, String> params,
  ) async {
    // Verify HMAC signature from Telegram
    final profile = verifyAndParseCallback(params);
    final user = mapProfile(profile);
    return CallbackResult.success(user, redirect: '/profile');
  }
}
Superclass constraints
Mixin applications

Properties

hashCode int
The hash code for this object.
no setterinherited
id String
Provider identifier used in callback routes.
finalinherited
name String
Human-readable provider name.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
type AuthProviderType
Provider category.
finalinherited

Methods

authenticationMethodInventory(AuthStore store) AuthAuthenticationMethodInventoryContributor?
Builds this provider's authoritative usable-method inventory.
inherited
handleCallback(AuthContext ctx, Map<String, String> params) FutureOr<CallbackResult>
Handles the callback request from the external provider.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
redacted() AuthProvider
Creates a provider metadata projection safe for events and audit logs.
inherited
toJson() Map<String, dynamic>
Summary payload used by /auth/providers.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited