firebase-authentication

How to remove the new firebase onAuthStateChanged listener in react

为君一笑 提交于 2019-12-20 19:41:04
问题 I'm implementing firebase auth in a react web app with react-router. A user signs in (at /signin) with either Facebook or Google using the popup sign in, then if successful I route to the main app (/). In the main app component I listen for an auth state change: componentWillMount() { this.authListener = this.authListener.bind(this); this.authListener(); } authListener listens for the auth change: authListener() { firebase.auth().onAuthStateChanged((user) => { if (user) { console.log('user

Firebase sign out not working in Swift

故事扮演 提交于 2019-12-20 18:15:22
问题 I am using newest Firebase API (3.2.1) and I am using this code to check if user is signed in: override func viewDidAppear(animated: Bool) { super.viewDidAppear(animated) if(self.navigationController != nil){ self.navigationController!.setNavigationBarHidden(true, animated: true) } if(FIRAuth.auth() != nil){ self.performSegueWithIdentifier("loginSuccessSegue", sender: self) } } In other words if auth object is present I am switching to other controller. On that controller I have sign out

How to handle custom firebase token expiry in Firebase 3.x.x

[亡魂溺海] 提交于 2019-12-20 12:35:34
问题 I have used " signInWithCustomToken() " to authenticate firebase user. This token expires in 1 hour. Firebase has recommended token expiration to 1 hour. If we modify the expiry while creating custom token using "php-jwt" library, firebase throws exception "The custom token format is incorrect. Please check the documentation". While searching for solutions, I found following thread- "Firebase Android Authentication failed: expired_token (Auth token is expired)" But refreshed token returned by

Changing bundle ID for Firebase

て烟熏妆下的殇ゞ 提交于 2019-12-20 12:34:19
问题 Early on in this project I made the error of not having the prefix com in the bundle identifier. Now I am ready to test flight and I have an invalid bundle identifier. Currently, my bundle identifier is mycompany.myProject but I want it to be com.mycompany.myproject . I have no problem switching to the desired bundle id for archiving the app and uploading to the app store. The steps I took to switch the app to the appropriate bundle identifier: Create new app in firebase console with correct

How to get the ID token from FirebaseAuth

ぐ巨炮叔叔 提交于 2019-12-20 12:24:08
问题 I am reading some Json files from my firebase database and I am trying to obtain an ID token for the current user to be used in the header as follows: var response = await httpClient.get(url,headers: {'Authorization':"Bearer ${FirebaseAuth.instance.currentUser.getToken()}"}); when I do the previous line, it seems that it does not get the correct token as I can not access the database, however, when I manually include an ID token in the string, my application works as intended. What is it

Firebase REST auth when creating token with node.js admin sdk

眉间皱痕 提交于 2019-12-20 10:45:07
问题 I know this issue was asked a lot here, but I still cannot seem to find the exact answer that can solve my problem. I wish to access Firebase using REST calls, by adding an access_token param. The access_token is created using the Node.js Admin SDK, using the following code: var admin = require("firebase-admin"); var serviceAccount = require("./pk.json"); admin.initializeApp({ credential: admin.credential.cert(serviceAccount), databaseURL: "https://XXX.firebaseio.com" }); var uid = "1234";

Firebase Auth using phone number returns an internal error

感情迁移 提交于 2019-12-20 10:35:22
问题 I set up my app to be able to send Apple Notifications using firebase and I verified that it works using the console. Now I want to do phone authentication which is built on top of APN. So I wrote this: PhoneAuthProvider.provider().verifyPhoneNumber(phoneNumber) { verificationID, error in if error != nil { print("Verification code not sent \(error!)") } else { print ("Successful.") } And I get: Error Domain=FIRAuthErrorDomain Code=17999 "An internal error has occurred, print and inspect the

How to pass Firebase Auth Token from client to server?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-20 10:33:15
问题 The website that I'm working on uses Firebase authentication and different users that login have different permissions as to which pages they can visit. The way signing in is setup is similar to this post: User Logins in with two parameters - "id" and "email" Server uses these to create a custom "uid", then uses the Firebase Admin SDK to create a custom token that is sent back to the client. The client logs in with the Javascript Firebase SDK - firebase.auth().signInWithCustomToken() Now that

Log user out after app has been uninstalled - Firebase

試著忘記壹切 提交于 2019-12-20 10:25:20
问题 My app won't log out the current user after the app has been uninstalled from the phone. I don't want the user to uninstall the app, and when they reinstall it they are already logged in. I think it has something to do with its keychain access maybe? Not sure. I was thinking maybe I needed to just un-authenticate the user once the app was deleted, but there is no way of checking that condition. The closest thing to that would be running the applicationWillTerminate function, but if I put my

Losing connection with Firebase database after updating to new SDK

回眸只為那壹抹淺笑 提交于 2019-12-20 10:23:50
问题 After updating my projects Firebase SDK, I noticed my app regularly lose connection with the firebase database. The time it would take to disconnect ranging from a few minutes to just over an hour. Once disconnected, the app would not reconnect until I have either logged out or cleared the apps data. Also right before I lose connection, an entry in the log states that my auth token has expired: PersistentConnection: pc_0 - Auth token revoked: expired_token (Auth token is expired.) FYI, im