firebase-authentication

Flutter user registration with Firebase: Add extra user information (age, username)

无人久伴 提交于 2020-05-14 14:23:36
问题 With a phpMySQL background, I'm a little bit lost. I've successfully created a registration process with Flutter and Firebase Auth (simple email/password method) following a tutorial. I would like add a "username" and "age" field to the registration form. In Firebase I've created a database called "users", and in it a String typed "userid" that's blank. But is it even necessary? What do I do next? How is it mapped to the User UID in the authentication table? How do I push it and retrieve it

Flutter user registration with Firebase: Add extra user information (age, username)

只愿长相守 提交于 2020-05-14 14:16:31
问题 With a phpMySQL background, I'm a little bit lost. I've successfully created a registration process with Flutter and Firebase Auth (simple email/password method) following a tutorial. I would like add a "username" and "age" field to the registration form. In Firebase I've created a database called "users", and in it a String typed "userid" that's blank. But is it even necessary? What do I do next? How is it mapped to the User UID in the authentication table? How do I push it and retrieve it

The current environment does not support the specified persistence type firebase

早过忘川 提交于 2020-05-13 07:56:06
问题 I get this error. "The current environment does not support the specified persistence type." I was testing my app and saw that when a user is logged in it's logged in everywhere. So I'm trying to implement sessions on node.js express using firebase hoping this will solve it. My code is this: router.post("/login", function (req, res) { email = req.body.email; password = req.body.password; firebase.auth().setPersistence(firebase.auth.Auth.Persistence.SESSION); firebase.auth()

How to prevent a hacker from reading/writing on firebase database

不羁的心 提交于 2020-05-13 07:06:45
问题 I have some questions about securing firebase database for mobile applications. For example, after decompiling Android application a hacker can get firebase api key and then get access to firebase database, is this correct? Let's assume, I added some security rules like for example an app can read/write on firebase only if auth!=null, this means that the authentication is protecting my firebase database, but this put me to ask the same question, if I configure facebook/google/ or even

How to restrict access to pages in next.js using firebase auth?

与世无争的帅哥 提交于 2020-05-13 06:36:25
问题 I am working on a next.js app which uses firebase. I need to use firebase auth package to restrict access to pages. The with-firebase-authentication example doesn't show authentication for multiple pages. import React from 'react'; import Router from 'next/router'; import { firebase } from '../../firebase'; import * as routes from '../../constants/routes'; const withAuthorization = (needsAuthorization) => (Component) => { class WithAuthorization extends React.Component { componentDidMount() {

Getting user info from request to Cloud Function in Firebase

旧街凉风 提交于 2020-05-13 05:14:02
问题 I'd like to be able to get user information for a Cloud Function that gets called in Firebase. I have something like this, which is being called after the user signs into the app: exports.myFunction = functions.https.onRequest((req, res) => { ... } And I need to get the uid of the signed-in user that made the request. Any advice or comments please? 回答1: Information about the user that makes the request is not automatically passed along with HTTPS functions calls. You can either pass the ID

Getting user info from request to Cloud Function in Firebase

*爱你&永不变心* 提交于 2020-05-13 05:11:20
问题 I'd like to be able to get user information for a Cloud Function that gets called in Firebase. I have something like this, which is being called after the user signs into the app: exports.myFunction = functions.https.onRequest((req, res) => { ... } And I need to get the uid of the signed-in user that made the request. Any advice or comments please? 回答1: Information about the user that makes the request is not automatically passed along with HTTPS functions calls. You can either pass the ID

Firebase get user by ID [duplicate]

孤人 提交于 2020-05-13 01:04:09
问题 This question already has answers here : How do I return a list of users if I use the Firebase simple username & password authentication (7 answers) Closed 3 years ago . Is there a way to get user information (like email, picture) based on its UID? I mean not for the currently logged user, but any other user. 回答1: If you're using the authentication methods provided by Firebase, then no, you can only get it from the current session/user, and if you need to query for it later then you need to

Firebase Auth : Admin custom tokens cannot be refreshed after one hour

天大地大妈咪最大 提交于 2020-05-12 12:05:13
问题 I think the Firebase Admin SDK is missing a very important function (or maybe its documentation). TL; DR : How can you refresh custom token with the Admin SDK? The documentation (https://firebase.google.com/docs/auth/admin/manage-sessions) says: Firebase Authentication sessions are long lived. Every time a user signs in, the user credentials are sent to the Firebase Authentication backend and exchanged for a Firebase ID token (a JWT) and refresh token. Firebase ID tokens are short lived and

Firebase Auth: Requests from this Android client application com.xxx are blocked

末鹿安然 提交于 2020-05-11 05:15:21
问题 I'm implementing the standard tutorial for Firebase AuthUI in my android app. However, when testing I try to sign-in using Google sign-in from within the app and get the following exception: com.google.firebase.FirebaseException: An internal error has occurred. [ Requests from this Android client application com.xxx are blocked. ] The app displays the "Google SmartLock" banner as if it's signing me in, but then disappears and in the logcat I see the error above. I verified that my SHA-1