Skip to content

Unable to get event_type from AuthBlockingEvent #224

Closed

Description

@axelmukwena

Given the Google Documentations here to Getting user and context information, some fields are not available on the AuthBlockingEvent dataclass.

For example I can extract the following:

from firebase_admin import initialize_app
from firebase_functions import https_fn, identity_fn, options

initialize_app()

@identity_fn.before_user_signed_in()
def handle_user(
    event: identity_fn.AuthBlockingEvent,
) -> identity_fn.BeforeSignInResponse | None:
    email = event.data.email
    uid = event.data.uid
    event_id = event.event_id

However, the following does on exist on the even signature.

from firebase_admin import initialize_app
from firebase_functions import https_fn, identity_fn, options

initialize_app()


@identity_fn.before_user_signed_in()
def handle_user(
    event: identity_fn.AuthBlockingEvent,
) -> identity_fn.BeforeSignInResponse | None:
    event_type = event.event_type
    auth_type = event.auth_type
    resource = event.resource
    # etc

Activity

  1. CorieW commented on Feb 10, 2025

    @CorieW
    Member

    Hi @axelmukwena,

    Thanks for reporting this issue! We’ve received it and are reviewing it. We’ll provide updates as soon as possible.

  2. assigned and unassigned on Feb 10, 2025
  3. self-assigned this
    on Apr 4, 2025
  4. CorieW commented on Apr 4, 2025

    @CorieW
    Member

    Yeah, it does seem to be missing from the class: https://github.com/firebase/firebase-functions-python/blob/main/src/firebase_functions/identity_fn.py#L242

    Property differences to docs:

    • missing event_type
    • missing auth_type
    • missing resource
    • has additional data property

    Also, just to note: firebase-functions seems to have completely different properties in it's AuthBlockingEvent:

    • has auth
    • has authType
    • has eventType
    • has params
    • has resource
    • has emailType
    • has smsType
  5. moved this from Needs Triage to Triaged in [Cloud] Extensions + Functionson May 1, 2025
  6. moved this from Triaged to In Review in [Cloud] Extensions + Functionson May 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

documentationImprovements or additions to documentation

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions