signInWithIdToken method

Future<AuthSession> signInWithIdToken(
  1. OAuthProvider provider,
  2. String credential
)

Sign in with a credential the app already holds.

  • Google: the idToken from Google Sign-In.
  • GitHub: the authorization code from GitHub OAuth. Auto-registers on first login.

Implementation

Future<AuthSession> signInWithIdToken(
  OAuthProvider provider,
  String credential,
) {
  return _post('/auth/sessions:oauth', {
    'provider': provider.name,
    'credential': credential,
  }, install: true);
}