Secure your app with Gemini
Key Takeaways
Secures an app using Google Authentication and database rules with Gemini on Google Cloud
Full Transcript
Christian, we left off talking about adding authentication to protect the customer's information. Where do we start? >> First, I want to make another backup of our code because it's in a good place right now and I want to protect that. Let's jump into CloudShell. And do you remember the command to copy all the contents of a folder? Oo, testing me right off the bat, huh? I think it was cp-r, then the folder you want to copy, then the destination. >> A plus. I'll copy the contents of my customers into [music] MC backups and call it past biz because we've added that past business button. >> Perfect. Now to add authentication, I'm assuming we use the Gemini web app to help us create a prompt to give to Gemini CLI again. >> You are correct. And we'll dig into prompting in the last module of this course. But yes, I use the Gemini web app to write a prompt that makes a few changes. Only the site owner will have access to the website and otherwise customer [music] data will be hidden entirely. Even if someone inspects the page with developer tools. >> Oh, sneaky. If we just make the web page invisible, someone could still find all its information if they inspect the elements. >> They could, which is why the prompt says, "Please provide the new text for fire store." And storage.ruules. [music] So, let's copy the whole prompt, head to our cloud shell tab, and paste it into Gemini CLI. >> Okay, it's asking permission to add the login logout buttons. So, we're going to allow once. >> Yes, we'll allow once to all its changes. It's making some big changes to firestore. The website owner will now have to log in before they can read and write data. Now that Gemini CLI is done, let's jump back to our other terminal tab [music] and create the testing environment with Firebase Serve. We'll click on the local server link to visit our previewed web app. >> Good sign. I notice a login button. The question is, does it work? >> It does not. But that's not a bug in the code. Authentication is handled by Firebase, but we need to actually set it up. We'll navigate to our project in Firebase console, then build authentication. Oh, cool. So, we can choose from any of these sign-in methods. >> We can, but we'll stick with Google for now. I'll add a public facing name for the project, my customers, and the support email, which is my Gmail. >> Okay, we added Google authentication. So, now we should be able to log in, right? But I'm watching you click it and it's not working. What's going on? >> Well, remember we are in the test environment which has its own specific domain. If I go back to inspect using the developer tools, we find this error. The current domain is not authorized. So, let's copy the test URL and go back into Firebase authentication and then settings. >> Okay. So, there's all the domains that will work, but our test environment isn't listed >> exactly. So, let's click add domain and paste the URL. I'll [music] delete the last bit of the URL to make it apply to the whole site. All right. So, now we can go back to our site, do a hard refresh, and then log in. In theory, so far so good. There's the sign-in popup window. Yep. I'll choose my account, click continue, and it worked. Let's click into Sam's card and check if it actually has a log out button, too. Still there. What if you log on now? >> Let's try it. Sam disappeared. Great. That's what we wanted. >> But can someone still find the info the sneaky way? Let's try. We use inspect to bring up the developer tools. And no, we can't access any of that sensitive info. There's status and account balance, but the actual entries are hidden. >> Great. And if we log back in, will Sam reappear? He does. Let's test it out in the [music] past business tab by logging out and back in. Great. So, everything is working as it should. >> But this is the test environment. We should test it on the live site. Yes, we should. We'll end the preview in CloudShell, then run Firebase deploy. Clicking on the hosting URL, it doesn't seem good, but if this ever happens, do a hard refresh. And there we go. Everything is there. And when I log out, everything disappears. All right, we got a pretty good web app. We can add and edit customers. We can find past work. And now we have authentication to keep everything protected. What's next? For folks watching, check out the self-guided lesson on authentication to solidify what you've learned. After that, Joe, we just have one more thing to add, an invoice generator. We'll do that in the next video. Stay tuned.
Original Description
Lock down your app so only authorized users can view sensitive information!
Learn how to protect your user data by adding Google Authentication and configuring database rules.
Check out the full course for interactive demos and labs → https://goo.gle/3ZuHX9g
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from Google Cloud · Google Cloud · 0 of 60
← Previous
Next →
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
Top 3 ways organizations are adjusting their cloud strategies to prepare for economic uncertainty
Google Cloud
Google Cloud Retail Search and Browse Console deep dive
Google Cloud
Google Cloud Backup and DR - How to mount, clone or restore a VMware VM
Google Cloud
Google Cloud Backup and DR - VMware vSphere Backup Overview
Google Cloud
Google Cloud Backup and DR - Creating backup Plans for VMware VM backups
Google Cloud
Google Cloud Backup and DR - Compute Engine Instance Backups and Sole Tenant Nodes
Google Cloud
Google Cloud Backup and DR - Managing Service Accounts
Google Cloud
Let’s solve for what’s next
Google Cloud
Google Cloud Executive Briefing Center | Cloud Space | Silicon Valley
Google Cloud
Tinyclues with Google Cloud offers CRM Intelligence to maximize conversions
Google Cloud
Aible partners with Google Cloud helping customers build predictive models within minutes
Google Cloud
TELUS streamlines big data ingestion with help from Google Cloud and Accenture
Google Cloud
Getting started with Apigee API Management
Google Cloud
Google Cloud Retail Search
Google Cloud
Building your first API proxy with Apigee
Google Cloud
Brands and agencies develop dynamic video ads with Connected-Stories NEXT and Google Cloud
Google Cloud
Redefining the transportation industry
Google Cloud
Google Cloud Project Katalyst
Google Cloud
Israel's Family Court: Creating more compelling experiences for its citizens
Google Cloud
Tausight partners with Google Cloud to help healthcare industry protect PHI activity & take action
Google Cloud
Google Cloud Retail Browse
Google Cloud
Verifying API keys and debugging your API proxy flow
Google Cloud
Getting started with Apigee API Management
Google Cloud
Adding policies to your APIs
Google Cloud
Google Cloud Backup and DR - Configuring Google Cloud VMware Engine to work with Backup and DR
Google Cloud
Topaz Subsea Cable
Google Cloud
Episode 29: Building a culture of data literacy with Latin America’s biggest ecommerce platform
Google Cloud
Weshalb Datananalysten die Sparringspartner von Produktmanagern sein sollten
Google Cloud
Warum und wie METRO eine Machine Learning-Pipeline implementiert hat
Google Cloud
Wie nutzt METRO Data Science, um geschäftliche Herausforderungen zu meistern?
Google Cloud
Google Cloud in Qatar. Let's get solving.
Google Cloud
Google Cloud for Qatar
Google Cloud
Doha has a new Google Cloud region
Google Cloud
The new Google Cloud region in Qatar
Google Cloud
Build, tune, and deploy foundation models with Vertex AI
Google Cloud
Generative AI on Google Cloud
Google Cloud
Who will be coming to Google Cloud Day Tel Aviv? #Shorts
Google Cloud
Protect your organization at the edge
Google Cloud
Google Cloud Backup and DR Alert Notifications setup
Google Cloud
Build, tune, and deploy foundation models with Generative AI Support in Vertex AI
Google Cloud
Where the Internet Lives: Data center on the prairie
Google Cloud
Which developer program are you joining?
Google Cloud
Lufthansa Group baut intelligente Systeme zur Vereinfachung des Flugbetriebs
Google Cloud
How ASML revived Moore's Law and remade chipmaking
Google Cloud
CMO of Unity celebrates Women's History Month
Google Cloud
Vint Cerf on Google Cloud Digital Leader
Google Cloud
Mobile World Congress 2023
Google Cloud
Topaz - Canada
Google Cloud
Google Data Cloud & AI Summit 2023: Reveal opportunities to transform your business
Google Cloud
Building a conversational bot with Google Cloud Gen App Builder
Google Cloud
Elisa Polystar and Google Cloud partner to bring the power of analytics and automation to CSPs
Google Cloud
Network modernization - how can CSPs start now?
Google Cloud
How Semios uses imported and remote models for inference with BigQuery ML
Google Cloud
Deliver your AI solutions up to 100 times faster with Google Cloud partner, Snorkel AI
Google Cloud
Capture consumer perspectives for CPG using NLP and analytics with Harmonya and Google Cloud
Google Cloud
Delivering Cloud-Native Network Transformation
Google Cloud
Proactively detect & investigate anomalies & data quality issues in BigQuery with Telmai
Google Cloud
Introducing AlloyDB Omni
Google Cloud
Episode 30: How Auto Trader transitioned to the cloud to analyze tricky customer data
Google Cloud
MongoDB Atlas on Google Cloud
Google Cloud
Related Reads
📰
📰
📰
📰
Swift typealias — What It Is, What It Does, and Why It Matters
Medium · Programming
s3fifo 1.0: Zero-Allocation S3-FIFO Cache for Node.js is Ready for Production
Dev.to · JeongSeop Byeon
Node.js Error Handling Patterns for Production Queue Systems
Dev.to · Faisal Nadeem
Make Your CLI Config Write Survive Ctrl-C Without Leaving Truncated JSON
Dev.to · Sam Rivera
🎓
Tutor Explanation
DeepCamp AI