Search code examples
firebasegoogle-cloud-platformfirebase-authenticationgoogle-cloud-cdn

Can I implement Firebase authorization for Google Cloud CDN URL?


I have a Firebase project where authenticated users can upload photos to storage bucket. I have my Google Cloud CDN setup properly to the storage bucket. Obviously the bucket contents are available to the world now. How may I use Firebase authentication with Google Cloud CDN?


Solution

  • You cannot directly protect Cloud CDN content with Firebase Authentication, but you can prevent content served by Cloud CDN from being accessed publicly.

    Signed URLs can be used to generate per-user, time-limited URLs that will only serve the content to that given user. Your application backend can sign and then issue these signed URLs.

    Users trying to access content without a Signed URL will receive a HTTP 403 unauthorized.