Firebase Auth Tutorial #17 - Intro to Custom Claims

Net Ninja · 79K views · 2019 · 5:42

Open on YouTube

Web developmentCloud, DevOps & reliabilitytutorial

Why Stack Overflow recommends it

Stack Overflow users link it when explaining how to use Firebase custom claims for role-based access such as admin users or upload permissions.

Recommended by 1 people across 1 different months, 2021 to 2022.

What it is

A short Net Ninja tutorial that introduces Firebase Authentication custom claims and outlines how they will be set up in the rest of the series. It is part 17 of a Firebase auth series that builds a Vue-based demo app.

What people said

Recommends GeorgeMenezes · 2021-11 · Stack Overflow · on “Firebase upload protection”

You could set up a user auth claim like "can_upload_pics" then check this claim whenever the user initiates an upload, you might want to use firebase functions to add custom claims. If done right the second option will work as expected checkout this video for a good explanation and example for custom claims [this video]

Cites React Enjoyer · 2021-10 · Stack Overflow · on “How to display a component when certain conditions are true in ReactJS?”

What I want to achieve display components based on user authority admin/!admin //Everyone can see this login/register/reset //Admin x paths //regular users y paths I have been having issues finding tutorials that explain properly step by step what I want to achieve I want to have an admin that has access to a different view than the other users, however the only video I found is not only outdated but in vue ( Firebase Auth Tutorial [this video] ) and not in react and I wasn't able to "translate" the code at some point to react so I got stuck it was about Custom Claims [LINK] (is like 4 videos, there are more but the ones that explain the auth stuff was 17-21) I try to understand it but it was too

Cites jhbiggs · 2022-01 · Stack Overflow · on “Cloud Firestore Security Rules give null for resource.data in production code”

Yes, however there was a comment from @thatjennperson on her video on writing firestore rules [this video] in which she explains that you never want to rely on client filters for security purposes. She explained that the custom claims can be used to match only those documents in firebase to which the user has been granted access.