Skip to content

Storage get_url() issue #142

@ininex

Description

@ininex

Looks like there are a lot of 403 forbidden issues relates to Firebase storage and I think I've figured out a way to solve it:

  1. Make sure to store the response after using put() for uploading images or files
  2. You can check what keys are inside response, please note 'bucket' and 'downloadTokens' are important keys we are going to use in the next step
  3. The actual file url that get_url() should provide is https://firebasestorage.googleapis.com/v0/b/{bucket}/o/{path_to_file}?alt=media&token={downloadTokens}
    Hightlight: I think current get_url() method cannot return url correctly for storage that needs auth to access. The current method return base url appended with idToken as file download url, which is wrong: the token used here should be downloadTokens instead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions