firebase-authentication

FirebaseUI Auth library: Google sign in fails with: W/AuthMethodPicker: Firebase login unsuccessful

孤街醉人 提交于 2019-12-06 06:25:00
问题 Using the available online documentation and this video: https://www.youtube.com/watch?v=0ucjYG_JrEE, I'm trying to start apply the new UI Auth library. Mail sign in works great, the Google sign in not: it gives a warning and the UI keeps showing the "Loading..." dialog. final FirebaseAuth auth = FirebaseAuth.getInstance(); auth.addAuthStateListener(new FirebaseAuth.AuthStateListener() { @Override public void onAuthStateChanged(@NonNull FirebaseAuth firebaseAuth) { FirebaseUser usr =

Rule for Firestore that enforce user to write a document with id equals to its own uid

心不动则不痛 提交于 2019-12-06 06:23:32
I would like to guarantee that an user can only add a document that has the same id that its auth.uid. For example, an user with id 1X0T6xC6hhRN5H02zLCN6SQtwby2 can only create/update the document /salesmen/1X0T6xC6hhRN5H02zLCN6SQtwby2 . At app level, it's done by the following command (both for create and update). this.db .collection("salesmen") .doc(user.uid) .set(data) .then(function() { //... At Firestore level, I am trying the following rule, but it's not working (it results in Error writing document: Error: Missing or insufficient permissions .). match /salesmen/{salesman} { allow read:

12501 error: Ionic what keystore is the app building with

雨燕双飞 提交于 2019-12-06 06:16:42
I am using Ionic 2 with GooglePlus Authentication . Everything works perfectly for iOS . For Android I build my app as follows: ionic build android For the Android build, I need a SHA1 keystore for Google Authentication. I have a Macintosh HD/Users/myname/.android/debug.keystore , so according to these instructions, I generate a keystore using (default password ' android '): keytool -exportcert -list -v -alias androiddebugkey -keystore ~/.android/debug.keystore The output looks correct. I use this SHA1 to for my Android Credentials as per the above instructions: But when I try login, I get:

firebase.storage() is not a function in jest test cases

夙愿已清 提交于 2019-12-06 06:10:59
问题 I am using Jest to test my firebase functions. This is all in the browser, so I don't have any conflicts with firebase on the server side. When I use firebase.auth() or firebase.database() everything works fine. When I try to use firebase.storage() my tests fail. Here is my firebase import and initialization: import firebase from 'firebase'; import config from '../config'; export const firebaseApp = firebase.initializeApp(config.FIREBASE_CONFIG); export const firebaseAuth = firebaseApp.auth()

Uncaught TypeError: Cannot read property 'uid' of null using website

杀马特。学长 韩版系。学妹 提交于 2019-12-06 06:07:13
问题 I want to get registered user details from firestore into html page. When user clicks my profile page it navigate to next html page with fields like first name and last name etc.. . This fields are already entered at the time of signup page. so i want get those details from firestore into next html page. But i got the error like "Cannot read property 'uid' of null ". How to resolve that problem this is my html page : <!doctype html> <html lang="en"> <head> <title> deyaPay</title> <meta

angularjs multiple resolve with loadsequence and auth permission

删除回忆录丶 提交于 2019-12-06 05:56:18
Referring to this question here , I am having the same problem. How can we set up a multiple resolve, one with currentAuth and another with loadsequence which loads controllers and scripts? Here is my state config : .state('app.example', { url: "/example", templateUrl: "assets/views/example.html", resolve:{ loadSequence: loadSequence('jquery-sparkline', 'exampleCtrl') }, title: 'example', ncyBreadcrumb: { label: 'example' } }) and here is my loadsequece function: function loadSequence() { var _args = arguments; return { deps: ['$ocLazyLoad', '$q', function ($ocLL, $q) { var promise = $q.when(1

Firebase: Get DisplayName from UID [duplicate]

天大地大妈咪最大 提交于 2019-12-06 05:41:51
This question already has answers here : How do I return a list of users if I use the Firebase simple username & password authentication (6 answers) Closed 2 years ago . I am storing user's display name in Firebase Auth. Fetching from Firebase Auth is simple when the same user is logged in. But, when another user is logged in, how do I fetch an account's display name when I have their unique UID (User ID). Jaimin Thakkar You can't The explanation is here How do I return a list of users if I use the Firebase simple username & password authentication You can instead set the user's uid to users

How to validate usernames using matches(regex)?

二次信任 提交于 2019-12-06 05:29:22
I'm trying to put the following expression into the matches function but I guess errors when trying to compile the rules. ^[a-zA-Z](([\._\-][a-zA-Z0-9])|[a-zA-Z0-9])*[a-z0-9]$ .validate rule looks as follows: ".validate": "newData.val() === auth.uid && newData.val().matches(^(?=.{5,10}$)(?!.*[._-]{2})[a-z][a-z0-9._-]*[a-z0-9]$)" I get: " Invalid escape: '\.'" It appears you cannot use lookarounds in Firebase, so your pattern and the whole approach should be adjusted to account for that. Your current regex requires a string length from 5 to 10 symbols, and disallows 2 consecutive symbols . , _

Firebase Database Rules to match row

泄露秘密 提交于 2019-12-06 05:13:44
问题 I am using a Firebase Realtime Database. I have the following data: I also have the rules: { "rules": { ".read": "auth != null", ".write": "auth != null", "chat": { "$key": { ".read": "data.child('memberId1').val() === auth.uid && data.child('memberId2').val() === auth.uid", ".write": "data.child('memberId1').val() === auth.uid || data.child('memberId2').val() === auth.uid" } }, The initial rule works perfectly: ".read": "auth != null", ".write": "auth != null", Problem The following 2 rules

How to use firebase with read and write rules as false

99封情书 提交于 2019-12-06 05:11:36
问题 I am working on a project and I followed few tutorials in order to learn and build the app. But all of them, they change the Firebase read and write rules to true which is not safe. for example they change { "rules": { ".read": false, ".write": false } } to { "rules": { ".read": true, ".write": true } } This gives access to anyone to read and write the server data which is not safe in any way. And hence I turned this to false and now I am unable to register the user to Firebase it is giving