Signs the user in using third-party OAuth providers.
The OAuth provider to use for signing in.
The URL to redirect the user to after they sign in with the third-party provider.
A list of scopes to request from the third-party provider.
The launch mode for the auth screen. Defaults to `LaunchMode.platformDefault`.
Additional query parameters to be passed to the OAuth flow.
await supabase.auth.signInWithOAuth(
OAuthProvider.github,
redirectTo: kIsWeb ? null : 'my.scheme://my-host', // Optionally set the redirect link to bring back the user via deeplink.
authScreenLaunchMode:
kIsWeb ? LaunchMode.platformDefault : LaunchMode.externalApplication, // Launch the auth screen in a new webview on mobile.
);
await supabase.auth.signInWithOAuth(
OAuthProvider.github,
redirectTo: kIsWeb ? null : 'io.supabase.flutter://reset-callback/',
);
await supabase.auth.signInWithOAuth(
OAuthProvider.github,
scopes: 'repo gist notifications'
);
...
// after user comes back from signin flow
final Session? session = supabase.auth.currentSession;
final String? oAuthToken = session?.providerToken;