getIdToken method

Future<String> getIdToken([
  1. bool forceRefresh = false
])

Returns a JSON Web Token (JWT) used to identify the user to a Firebase service.

Returns the current token if it has not expired. Otherwise, this will refresh the token and return a new one.

If forceRefresh is true, the token returned will be refresh regardless of token expiration.

Implementation

Future<String> getIdToken([bool forceRefresh = false]) async {
  _assertSignedOut(_auth);

  await _refreshIdToken(forceRefresh);

  return _idToken;
}