verifyIdToken method

Future<IdToken> verifyIdToken(
  1. String idToken, [
  2. bool checkRevoked = false
])

Verifies a Firebase ID token (JWT).

If the token is valid, the returned Future is completed with an instance of IdToken; otherwise, the future is completed with an error. An optional flag can be passed to additionally check whether the ID token was revoked.

Implementation

Future<IdToken> verifyIdToken(String idToken,
    [bool checkRevoked = false]) async {
  var decodedIdToken = await _tokenVerifier.verifyJwt(idToken);
  // Whether to check if the token was revoked.
  if (!checkRevoked) {
    return decodedIdToken;
  }
  return _verifyDecodedJwtNotRevoked(decodedIdToken);
}