firebase-authentication

Configure Swagger Authentication with Firebase (google) in .Net core

久未见 提交于 2020-06-08 15:12:05
问题 Integrating swagger and firebase is really hard because google token request and response is not standard. so I used password flow and add a middleware in .net core 3.1 Web API to authenticate swagger 5.x I hope it helps. The first step is configuring your API to use Firebase for token validation. so we need to add this code to the startup. services.AddAuthentication(options => { options.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme; options.DefaultChallengeScheme =

flutter - How to keep user signed-in with Google

自作多情 提交于 2020-06-08 13:15:04
问题 I have used Google Sign In to authenticate users with Firebase Auth, and I successfully get back my Firebase User. I want to keep the user authenticated, when they come back to the app. How can I do the same? 回答1: Users already stay authenticated. After you restart the app, Firebase reads the credentials from disk, and refreshes the user's token. Since this requires a roundtrip to the server, it happens asynchronously. So be sure to await _auth.currentUser() to get notified of the user's

flutter - How to keep user signed-in with Google

*爱你&永不变心* 提交于 2020-06-08 13:14:04
问题 I have used Google Sign In to authenticate users with Firebase Auth, and I successfully get back my Firebase User. I want to keep the user authenticated, when they come back to the app. How can I do the same? 回答1: Users already stay authenticated. After you restart the app, Firebase reads the credentials from disk, and refreshes the user's token. Since this requires a roundtrip to the server, it happens asynchronously. So be sure to await _auth.currentUser() to get notified of the user's

Only let pre-verified users log into Firebase

纵然是瞬间 提交于 2020-06-07 06:52:32
问题 Right now, I only want users who have already registered and been verified with our software to login, and I have saved the list of emails of users (stripped of special characters) inside Firebase. Currently, when the user logs in, I use the following function to check if their email is in this list: function isEmailValid(userEmail, trueCallback, falseCallback) { var emailHash = userEmail.replace(/[^a-zA-Z0-9]/g, ""); firebase .database() .ref("validEmails/" + emailHash) .on("value", snapshot

Firebase Auth Are my variables secure/safe?

。_饼干妹妹 提交于 2020-06-01 07:41:26
问题 I am currently using heroku to store my environmental variables for my firebase authentication initialisation. I am using my server to get the environmental variables and send it to the client using socket.io. Below is what I mean. 1) Example of sending environmental variable to client from server: socket.emit('value', process.env.apiKey); 2) storing it as data[0] in the client: socket.on('value', function(data) { firebase.initializeApp({ apiKey: data[0], }); }) Is this safe? Can someone from

Firebase Auth Are my variables secure/safe?

拟墨画扇 提交于 2020-06-01 07:41:08
问题 I am currently using heroku to store my environmental variables for my firebase authentication initialisation. I am using my server to get the environmental variables and send it to the client using socket.io. Below is what I mean. 1) Example of sending environmental variable to client from server: socket.emit('value', process.env.apiKey); 2) storing it as data[0] in the client: socket.on('value', function(data) { firebase.initializeApp({ apiKey: data[0], }); }) Is this safe? Can someone from

Firebase (Phone Auth) Getting iOS error: register custom URL scheme

北战南征 提交于 2020-06-01 07:03:49
问题 My flutter app uses Firebase Auth (Phone). I keep seeing the error: 'Please register custom URL scheme 'com.googleusercontent.apps.602546125958-5lk04ghhdfj5xxxxxxxx' . I have added the URL schema to the info.plist as follows, but I'm getting the same error. 2020-04-29 20:40:05.173962-0400 Runner[395:20944] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Please register custom URL scheme 'com.googleusercontent.apps.602546125958-5lk04ghhdfj5xxxxxxxx'

How to check if a user already exists in firebase during phone auth

不羁的心 提交于 2020-06-01 05:56:10
问题 I'm trying to create an app that only uses phone authorization from firebase. Since the login/signup is done through same process, which is verifying the sent code. How can i check if a user already exists in firebase? I need this to show them appropriate User Interface. 回答1: Right now, the only way to do that is via the Firebase Admin SDK. There is an API to lookup a user by phone number. admin.auth().getUserByPhoneNumber(phoneNumber) .then(function(userRecord) { // User found. }) .catch

I have trouble writing code for firebase anonymous login in android [closed]

走远了吗. 提交于 2020-06-01 05:37:08
问题 Closed. This question needs debugging details. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 days ago . I am getting this error: W/SyncTree: Listen at /Bible/card_6 failed: DatabaseError: Permission denied Someone said that my app is trying to query before signing in. and my app works when I run my app for the second time not the first time after fresh installing through android studio, so I think it has

How to fix “This operation is not supported in the environment this application is running on. ”location.protocol“ …” error?

纵然是瞬间 提交于 2020-05-31 23:32:30
问题 I try to use Firebase (Google) authentication but I'm getting this error: This operation is not supported in the environment this application is running on. "location.protocol" must be http, https or chrome-extension and web storage must be enabled. My code is: var provider = new firebase.auth.GoogleAuthProvider(); function Singin(){ firebase.auth().signInWithPopup(provider).then(function(result) { var user = result.user; console.log(user); }).catch(function(error) { console.log(error);