FirebaseAuthValidator class

An object to validate JWTs from Firebase Auth.

Usage

Validating is easy! Just

  1. Create a FirebaseAuthValidator()
  2. Initialize with validator.init()
  3. Validate JWT with validator.validate()
final jwt = '...';  // Generated with a client library and sent with the request
final validator = FirebaseAuthValidator();
await validator.init();
final idToken = await validator.validate(jwt);

Constructors

FirebaseAuthValidator({PlatformWrapper? platformWrapper, @visibleForTesting Client? httpClient, @visibleForTesting Client? openIdClient})
{macro firebase_auth_emulator}

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

init({String? projectId}) Future<void>
Initializes authenticator and sets the project id. Must be called before validate is called.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
validate(String token) Future<IdToken>
Validates a given JWT from Firebase Auth.

Operators

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