Firebase Auth Tutorial #18 - Cloud Function / Adding Claims

  Рет қаралды 64,999

Net Ninja

Net Ninja

Күн бұрын

Hey gang, in this video I'll show you how to add a custom auth claim by using a firebase cloud function.
VUE & FIREBASE FULL COURSE - www.udemy.com/...
----------------------------------------
🐱‍💻 🐱‍💻 Course Links:
+ Course files - github.com/iam...
+ VS Code editor - code.visualstu...
+ Firestore Playlist - • Firebase Firestore Tut...
+ Materialize Playlist - • Materialize Tutorial #...
🤑🤑 Donate
+ www.paypal.me/...
🎓🎓 Find me on Udemy
+ www.udemy.com/...

Пікірлер: 130
@justnumber5197
@justnumber5197 3 жыл бұрын
i turned off the adblocker and watched the whole ad you deserve it net ninja!
@NetNinja
@NetNinja 3 жыл бұрын
Thanks so much :)
@Bear-nr9jo
@Bear-nr9jo 3 жыл бұрын
@@NetNinja I just have KZbin premium but still, your vids are a saviour thanks mate 🙏
@douglasDGmarques
@douglasDGmarques 5 жыл бұрын
So excited for a Firebase cloud function course 👌🔥🔥
@ppotter10
@ppotter10 4 жыл бұрын
Love your simple, short (yet, not too short) videos! Thanks!
@thecomeup4943
@thecomeup4943 5 ай бұрын
Its funny that you said you wouldnt explain the cloud functions too much, but you did an awesome job! Super helpful
@Cho1279624
@Cho1279624 5 жыл бұрын
It's not easy for me to understand it fully, but I will try to follow you. Thank you, Shaun!
@filgarte5681
@filgarte5681 3 жыл бұрын
Hello Net Ninja! I know you're a busy person, but do you know an alternative for the Blaze (pay-as-you-go) plan? apparently you need that now in order for this to work.
@AmitabhSharma486
@AmitabhSharma486 4 жыл бұрын
hey Shaun, thanks for all the awesome courses, waiting for the cloud functions.
@Olejoss1906
@Olejoss1906 Жыл бұрын
Not gonna lie, I'm in need to rewind that part with returns and promises mix to understand it completely. But his is how it works during learning process, sometimes you gotta repeat few (and even dozen) times the same part to comprehend it deeply.
@kortiszallios4524
@kortiszallios4524 4 жыл бұрын
Error: Cloud Functions deployment requires the pay-as-you-go (Blaze) billing plan. To upgrade your project, visit the following URL: console.firebase.google.com/project/mqc-store/usage/details So it seems now the deployment is locked until we pay for the service. Sad...
@yakivkuzmenkowich9294
@yakivkuzmenkowich9294 4 жыл бұрын
open: functions/package.json change: "node":"10" to "node":"8"
@astrix8812
@astrix8812 3 жыл бұрын
@@yakivkuzmenkowich9294 This comment needs to be on the TOP! Thank you very much :)
@ronidaou95
@ronidaou95 2 жыл бұрын
@@yakivkuzmenkowich9294 This doesn't work anymore
@apiapi3283
@apiapi3283 5 жыл бұрын
Wow, thank Net Ninja! I cannot wait for your cloud functions series!!!
@abeechr
@abeechr 5 жыл бұрын
Would LOVE a full series on cloud functions.
@NetNinja
@NetNinja 5 жыл бұрын
There will be at some point :)
@mrgrossartig
@mrgrossartig 3 жыл бұрын
@@NetNinja At some point. ;) Really love this course and also just became a member. And looking forward to do more tutorials with you. :)
@ramymagdy3482
@ramymagdy3482 2 жыл бұрын
recently cloud functions became among firebase paid plan, is there a way to achieve this functionality by the backend? say a bool value that only users marked as admins are capable of changing? and would it be as much reliable as the cloud functions? Great content, keep up the good work 👍
@khalilebrhaim6010
@khalilebrhaim6010 5 жыл бұрын
thanks, sensei.. can't wait for the new lesson
@aurora23301
@aurora23301 3 жыл бұрын
You are just awesome Net Ninja! I just love your tutorials! So much informative. :) The best teacher I must say :)
@NetNinja
@NetNinja 3 жыл бұрын
Thanks so much :)
@sasuke80889
@sasuke80889 3 жыл бұрын
@@NetNinja I finished up 2 firebase courses thanks to your tutorials :) Shaun I have a question about the 'Storagr' part in the firebase. Can that be utilised for storing media files of a particular user? For e.g profile photo for each signed up user? Would love your insights on this... Thanks a bunch! :)
@michaltal-socher4513
@michaltal-socher4513 3 жыл бұрын
Hi there ninja, I am an avid follower of your tutorials here and at Udemy. Just a note- as of april 2021, use of the cloud functions reuires upgrading to the Blaze plan (I received a notification when trying to deploy the function ). Is there any way around it? or is it safe to assume that use for learning purposes will keep us at the free level of the plan? Thanks a lot!
@ronidaou95
@ronidaou95 2 жыл бұрын
Did you ever find a solution to this?
@laserflip8094
@laserflip8094 2 жыл бұрын
The Firebase free plan (Spark) usage is included in the Blaze plan, so there's no way you would be charged under the Blaze plan based on the usage required to complete this course. I'd recommend setting up a Blaze plan and adding a max budget of $1 just in-case. Then downgrade after you've completed this course.
@kausarbanu8302
@kausarbanu8302 5 жыл бұрын
Please do videos on cloud functions ur series are osm
@logickee
@logickee 4 жыл бұрын
Sorry I may miss something here. May I know the reason why using the 'functions.https.onCall' but not the default one 'functions.https.onRequest' ?
@KellyAnderson-v5k
@KellyAnderson-v5k Ай бұрын
The cloud functions feature is not free anymore. Is there any other way to add claims?
@rintintin_
@rintintin_ 4 жыл бұрын
This is awesome! thank you so much!
@Yassinius
@Yassinius 3 жыл бұрын
The function addAdminRole doesn't work for me. I'm getting the error "Unhandled Rejection (RangeError): Maximum call stack size exceeded", and I really don't understand why this happens
@hardiksachan
@hardiksachan 3 жыл бұрын
Is there a way to set up custom claims without firebase functions??
@SofianMW
@SofianMW 4 жыл бұрын
Always great!
@Ryan-ie5uy
@Ryan-ie5uy 3 жыл бұрын
Error: HTTP Error: 400, Billing account for project '31791270628' is not found. Billing must be enabled for activation of service(s) 'cloudbuild.googleapis.com,containerregistry.googleapis.com' to proceed. Q: Now need to pay for deploy?
@KG-fj1ex
@KG-fj1ex 5 жыл бұрын
Thank You Dear Ninja Man...
@ilustrado7291
@ilustrado7291 4 жыл бұрын
"Senpai"
@dodoromero1837
@dodoromero1837 4 жыл бұрын
it's fantasic that you're doing for us. I am following your course and I have reached this point, and the moment I make the email post for admin, it gives me problems with the CORS. how can i solve ??? HELP!!
@salimlyoussi9608
@salimlyoussi9608 4 жыл бұрын
"firebase-functions" and "firebase-admin" require many other modules to be installed (such as 'fs', 'path', 'url', 'crypto', 'http', 'https, 'zlib' and many others) is there any solution for that as I got into many troubles and I could not handle all those installs.
@HasanTezcan
@HasanTezcan 3 жыл бұрын
I got an error like this Error: function is not a valid feature. Must be one of database, firestore, functions, hosting, storage, emulators, remoteconfig, hosting:github
@kingsleyshacklebolt7335
@kingsleyshacklebolt7335 2 жыл бұрын
hi ¿why so many returns? ¿can hou explain that please? im not getting the idea
@siegfrieddallanzabader
@siegfrieddallanzabader 4 жыл бұрын
Good evening Is there the possibility to send verification emails (for a 'forgot password' functionality fir example)?
@HasanTezcan
@HasanTezcan 3 жыл бұрын
how can we build it?
@ikennaakupuome9595
@ikennaakupuome9595 2 жыл бұрын
if you encounter upload errors : "HTTP Error : 403", when setting up the admin add the firebaseconfig object to iniatializeApp. e.g . admin.initializeApp(firebaseConfig);
@brianlarsen3209
@brianlarsen3209 4 жыл бұрын
Http request is open to a call from anywhere and anyone. Just use Postman to make all the admins you want.
@NetNinja
@NetNinja 4 жыл бұрын
Hey at the moment that’s true, but in lesson 22 we secure the cloud function so not anyone can add admins.
@tahirmehmood6025
@tahirmehmood6025 10 ай бұрын
only premium users can use functions feature?
@peterlinddk
@peterlinddk 4 жыл бұрын
I got a lot of NPM errors when doing the firebase init, and the firebase deploy wouldn't work, but suggested that I ran a npm install in the functions directory. However that didn't work at all - took forever, and failed everytime. But doing a npm install firebase-functions@latest firebase-admin@latest --save inside the functions directory, worked, and I was subsequently able to do a firebase deploy. Thought others might run in to the same problem.
@dusanmilanovic6398
@dusanmilanovic6398 4 жыл бұрын
Thanks
@fellainthewagon7166
@fellainthewagon7166 3 жыл бұрын
after changing to "node": "8" gives an error: Error: package.json in functions directory has an engines field which is unsupported. Valid choices are: {"node": "10"}, {"node": "12"}, and {"node": "14"}. help please..
@Kylegil00
@Kylegil00 3 жыл бұрын
they stop people using node 8 on the 15 of feb this year so it looks like you will have to pay
@MuhammedFatihKocaplus
@MuhammedFatihKocaplus 4 жыл бұрын
it's a really nice tutorial, Thank you. I have a question when I try to add exports.addNewRole, it doesn't come just update addAdminRole and remove my changes code. How can I add new role
@joaofelipenascimento8248
@joaofelipenascimento8248 5 жыл бұрын
Can I create multiple rules, for example rule for manager, director, sector A, sector B, etc?
@Nephinim
@Nephinim 5 жыл бұрын
Is there anyway to delete a deploy, I deployed on accident?
@JoshuaTMagee
@JoshuaTMagee 3 жыл бұрын
Great tutorial series, as always! If we already have a Firebase Auth user successfully logged into our web app, how can we reference that logged-in user in the setCustomUserClaims() function without having to first pass their email and call getUserByEmail()?
@aliasgar.burhani1099
@aliasgar.burhani1099 3 жыл бұрын
I dont like that it automatic cuts the payment from your account it should warn first then close our project if we dont pay rather than just taking the money automatically from our cards. I dont mind limiting the free tier of cloud functions
@jishnuraj9870
@jishnuraj9870 5 жыл бұрын
Hi Shaun, will you teach as implementing web push in this project ?
@songwright
@songwright 5 жыл бұрын
When I tried "firebase deploy --only functions:", it failed, but Firebase sent a message suggesting that I use this command: firebase deploy --only functions: addAdminRole This time, it worked.
@TheErayT
@TheErayT 3 жыл бұрын
I don't understand that... There is an open endpoint and anyone can send an e-mail there to get an admin privilege!? wut?
@jishnuraj9870
@jishnuraj9870 5 жыл бұрын
Please make a new KZbin series on the subject 'Intro to Progressive Web Apps" and please teaching as implementing Web push notifications, PWA install buttons, different service-worker cache features and other latest features of web ?
@moaazbhnas886
@moaazbhnas886 4 жыл бұрын
Why not just pass the `uid` directly and use it instead of the email?
@junaidshaikh1177
@junaidshaikh1177 4 жыл бұрын
Still waiting on that cloud function series you promised :P
@saifrehman8631
@saifrehman8631 4 жыл бұрын
Still waiting for you cloud function series man :)
@anuraghazra4772
@anuraghazra4772 5 жыл бұрын
Can you please make a video on react animation libraries, react-spring Or something? Please
@markusgattol
@markusgattol 5 жыл бұрын
why don't you take the email from the context like so? const email = context.auth.token.email || null;
@NetNinja
@NetNinja 5 жыл бұрын
Hey, because ultimately we'll be making other users admins. Using the context would take only the currently logged in user email - we don't want people to make themselves admins. Will become more clear as we go on.
@markusgattol
@markusgattol 5 жыл бұрын
@@NetNinja ok, understood but then how do you make sure the 'right' email is send from the client i.e. it corresponds with the person you want to make admin?
@NetNinja
@NetNinja 5 жыл бұрын
eventually we'll be sending a request from the front end via a little admin panel, where an admin can enter an email and make that user an admin too. So that will be the email / user that gets the auth claim. If no sich user exists, we'll get an error back to the front end we could handle.
@vladimirmiljkovic8758
@vladimirmiljkovic8758 5 жыл бұрын
Hi there, Could you make a tutorial for Magento?
@NetNinja
@NetNinja 5 жыл бұрын
Weird, was thinking about that yesterday. At some point I think I will be doing it, yeah :)
@vladimirmiljkovic8758
@vladimirmiljkovic8758 5 жыл бұрын
The Net Ninja Great, I hope it will be done soon. :)
@Accou25
@Accou25 4 жыл бұрын
They updated terms and now we need to switch the project to payed Blaze plan to deploy functions. It has the same free quota from free Spark plan though. Deployment worked only after I enabled Blaze.
@abdulazeezolalere9638
@abdulazeezolalere9638 4 жыл бұрын
Please how do you enable blaze?
@Accou25
@Accou25 4 жыл бұрын
@@abdulazeezolalere9638 When you got your project opened in firebase console, there's a plan button at the bottom of the sidebar. You gonna need to set up google payment account after choosing Blaze if you don't have it yet. After finishing tutorial just switch it back to Spark, if you wanna keep the project.
@abdulazeezolalere9638
@abdulazeezolalere9638 4 жыл бұрын
@@Accou25 Thanks
@amyra98
@amyra98 3 жыл бұрын
firebase deploy --only functions
@abeechr
@abeechr 5 жыл бұрын
NN! Have you ever thought about doing a live coding demo?
@NetNinja
@NetNinja 5 жыл бұрын
Yeah, maybe. Could do some kind of project based thing I guess..
@abeechr
@abeechr 5 жыл бұрын
@@NetNinja Would love that... Thanks for all you do.
@jomy10-games
@jomy10-games 3 жыл бұрын
I think I'm going to skip the cloud functions and just do everything in the firebase console, that's enough for my needs, that way I don't have to upgrade my subscription plan.
@raynardtjhang2706
@raynardtjhang2706 3 жыл бұрын
how do you make someone admin from the firebase console? thanks in advance
@rodneyperello
@rodneyperello 4 жыл бұрын
Now, you have to pay for the deployment of the functions. I would like to finish the tutorial, unfortunately, I have to stop here because of the function deployment.
@yakivkuzmenkowich9294
@yakivkuzmenkowich9294 4 жыл бұрын
open: functions/package.json change: "node":"10" to "node":"8"
@shadmanmartinpiyal4057
@shadmanmartinpiyal4057 3 жыл бұрын
8th February, 2021..... "npm install -g firebase-tools@8" and in package.json file., node:8... all works fine...
@filgarte5681
@filgarte5681 3 жыл бұрын
how about now?
@Kylegil00
@Kylegil00 3 жыл бұрын
@@filgarte5681 no, they stop people using node 8 on the 15 of feb this year so it looks like you will have to pay
@igdev6095
@igdev6095 3 жыл бұрын
OMG i can't use cloud function
@mohamedmidou3494
@mohamedmidou3494 3 жыл бұрын
great video but pay-as-you-go ... i can't finish
@hojdog
@hojdog 5 жыл бұрын
fyi you don't have to catch errors in functions, they catch them for ya
@fcandann
@fcandann 3 жыл бұрын
your project must be on the Blaze (pay-as-you-go) plan to complete this command.:(
@jorge_hts
@jorge_hts 3 жыл бұрын
Really?
@dembrosstudios2076
@dembrosstudios2076 4 жыл бұрын
I tried running your code exactly how it is on GitHub and I received an error
@ilustrado7291
@ilustrado7291 4 жыл бұрын
Ok? Then?
@markusgattol
@markusgattol 5 жыл бұрын
360p resolution? I can't read the text/code...
@dilass
@dilass 5 жыл бұрын
Give it a bit of time. That's how KZbin processes video quality. Higher quality is still being processed
@markusgattol
@markusgattol 5 жыл бұрын
@@dilass true, few minutes later it was avail in 1080p... :)
@dilass
@dilass 5 жыл бұрын
Mark yeah it is pretty frustrating but oh well
@HostDotPromo
@HostDotPromo 5 жыл бұрын
I see 480
@khalilebrhaim6010
@khalilebrhaim6010 5 жыл бұрын
@@dilassdownload it .. it gets cleared.
@rishabhborn2win
@rishabhborn2win 4 жыл бұрын
CommandNotFoundException
@BlueyMcPhluey
@BlueyMcPhluey 4 жыл бұрын
cloudFunctionsSeriesRequest += 1;
Firebase Auth Tutorial #19 - Adding Admins
8:07
Net Ninja
Рет қаралды 96 М.
Firebase Functions Authentication - The Diligent Dev
20:35
Diligent Dev
Рет қаралды 20 М.
Cute
00:16
Oyuncak Avı
Рет қаралды 3,6 МЛН
Cute kitty gadgets 💛
00:24
TheSoul Music Family
Рет қаралды 22 МЛН
Throwing Swords From My Blue Cybertruck
00:32
Mini Katana
Рет қаралды 11 МЛН
مسبح السرير #قصير
00:19
سكتشات وحركات
Рет қаралды 11 МЛН
How do Cloud Functions work? | Get to know Cloud Firestore #11
18:21
Every JavaScript Developer Has Made This Mistake With Functions
7:17
Web Dev Simplified
Рет қаралды 107 М.
Best practices for Firebase Messaging
12:46
Firebase
Рет қаралды 10 М.
Getting started with Cloud Functions
19:26
Firebase
Рет қаралды 42 М.
Firebase - Back to the Basics
25:23
Fireship
Рет қаралды 589 М.
Securing Cloud Function using Google Cloud API Gateway
21:48
Cloud Advocate
Рет қаралды 27 М.
Cute
00:16
Oyuncak Avı
Рет қаралды 3,6 МЛН