MODULES / 07 · DART & FLUTTER

Firebase and authentication

Prerequisites

Modules 4 and 5, and separation of data interfaces.

Learning objectives

Understand sessions, authorization, remote persistence and access-rule testing.

Suggested activity

Choose an application and identify its documented local and Firebase workflows. Use emulators when configured; production accounts are not prerequisites for the interface exercises.

The sign-in methods in the 2019–2020 index provide historical context. Phone, Google or password sign-in should only be presented as available when the current version implements and documents it. Use the current version of the chosen repository, synthetic data and its documented validation steps. Record the environment and distinguish real execution, emulation and a local demonstration. These activities are proposals for your own study repository.

Suggested reading

A Guerra das Arquiteturas: discuss boundaries between identity, access rules and storage.

Books & sites

Case studies and references

Labs for this module

These activities connect each laboratory to the lesson. Integration suggestions are adaptations for your own project.

Apply in your course project

Decision Engine

In the lesson application, persist an alternatives-and-weights scenario in the Firebase emulator under the authorized test user. The decision lab itself does not provide authentication or embedded Firebase.

What to check: Test that a second user cannot modify the scenario and that ranking uses only the data loaded after authorization.

Explore the laboratories

05 / EXERCISES

Exercises

  1. 01

    Sessions

    Objective: Model signing in, signing out and an expired session.

    Completion criteria: Cover all three states in tests using test data.

  2. 02

    Authorization

    Objective: Define who may edit a record.

    Completion criteria: Provide a rule or policy test that denies access to a different user.

  3. 03

    Persistence

    Objective: Separate local and remote implementations.

    Completion criteria: Provide a common contract and identify the execution mode in the interface or documentation.

  4. 04

    Errors

    Objective: Handle a failed write.

    Completion criteria: Report the error and avoid confirming success prematurely.

  5. 05

    Configuration

    Objective: Reproduce the test environment.

    Completion criteria: Provide instructions without secrets and evidence of executed tests, distinguishing the emulator from production.