firebase-authentication

Firebase auth user.getIdToken() sending expired tokens

前提是你 提交于 2020-12-13 06:39:04
问题 As far as I know, getIdToken() should by default send an unexpired token to the server, handling the token refreshing internally. However, I am getting many many errors from my server regarding expired tokens. On my frontend, I created axios instance as follows: const base = axios.create({ baseURL: apiUrl, }); base.interceptors.request.use(async (config) => { const token = await getAccessToken(); config.headers.Authorization = `Bearer ${token}`; return config; }); const getAccessToken = async

Google Sign In throws an exception com.google.android.gms.common.api.ApiException: 12500

半世苍凉 提交于 2020-12-13 03:33:46
问题 I have a simple application written in Android, where I want to do Google Sign and then Firebase Authentication. I copy paste the code from official page. val gso = GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN) .requestIdToken(getString(R.string.default_web_client_id)) .requestEmail() .build() if (requestCode == REQUEST_CODE_GOOGLE_SIGN_IN) { val task = GoogleSignIn.getSignedInAccountFromIntent(data) try { // Google Sign In was successful, authenticate with Firebase val

Firebase Auth - After updating the user's email, Firebase Auth logs out the user

谁说我不能喝 提交于 2020-12-12 04:57:46
问题 I am using Firebase Auth in my app. I update the email like follows: firebaseAuth.currentUser?.updateEmail(email) The email is updating 100% (I do a re-auth when necessary as well). My problem is after the e-mail has changed, the user is being logged out of his account and has to login again. When I call val user = firebaseAuth.currentUser after updating the email the user is null and my app wants you to login again with the new email address. Is this the correct behaviour? It makes for a

Firebase auth unit testing error No Firebase App

帅比萌擦擦* 提交于 2020-12-12 02:24:24
问题 I'm trying to test my firebase auth methods. Auth methods are signin, signout , register, etc. this are methods i want to perform unit test. I'm getting error No Firebase App '[DEFAULT]' has been created - call Firebase.initializeApp() I tried to initialize Firebase.initializeApp in test main method its also doesn't work. class MockUserRepository extends Mock implements AuthService { final MockFirebaseAuth auth; MockUserRepository({this.auth}); } class MockFirebaseAuth extends Mock implements

Adding a new header to a Request, while preserving the body

懵懂的女人 提交于 2020-12-09 09:50:28
问题 I am setting up a PWA for my company in house usage. What method should I use to attach a bearer token to all of the requests from dom or web-worker. This method that I am using works as expected when posting a form or json but I would like a cleaner or friendlier method as I don't trust that the text fallback will suffice. I was looking for a function in Google's workbox.js service worker module to see if I could set up a intercept to always append the Bearer token when a request gets made

“NoSuchMethodError: tried to call a non-function, such as null: 'dart.global.firebase.auth'” when initializing auth() in flutter for web

被刻印的时光 ゝ 提交于 2020-12-08 06:53:42
问题 I'm trying to implement sign-in function with Firebase Authentication in Flutter for Web app. I can already use Firestore to store/ extract data in the same app without signing-in. When executing the app, it shows the error "NoSuchMethodError: tried to call a non-function, such as null: 'dart.global.firebase.auth'" I think the error is caused by calling auth() method. Can you please advise how I should fix it? Or, is Firebase Authentication not supported Flutter for web yet?? Imported

Firebase tokens expiration and best practice for handling refresh tokens

主宰稳场 提交于 2020-12-07 08:57:49
问题 I am currently using Firebase on a client application (Cordova based mobile app) using the firebase user authentication methods on the client: signInWithEmailAndPassword FacebookAuthProvider From my current understanding and experience with the sessions expiring: " Authentication sessions don't expire with Firebase login. But the ID token will have to be refreshed hourly, to keep access to the services. " I assume this would mean I should just write a background process method that runs every

W/System: Ignoring header X-Firebase-Locale because its value was null

 ̄綄美尐妖づ 提交于 2020-12-07 00:48:10
问题 Im very new to android studio. I'm trying to make a signup page with email and password authentication with Firebase. Howerver, whenever I try to click the sign up button it gives: W/System: Ignoring header X-Firebase-Locale because its value was null Can anyone tell me why? Here is the SignupActivity.java file package com.example.traintrack; import android.app.Activity; import android.content.Intent; import android.graphics.Color; import android.os.Bundle; import android.text.TextUtils;

W/System: Ignoring header X-Firebase-Locale because its value was null

六眼飞鱼酱① 提交于 2020-12-07 00:47:21
问题 Im very new to android studio. I'm trying to make a signup page with email and password authentication with Firebase. Howerver, whenever I try to click the sign up button it gives: W/System: Ignoring header X-Firebase-Locale because its value was null Can anyone tell me why? Here is the SignupActivity.java file package com.example.traintrack; import android.app.Activity; import android.content.Intent; import android.graphics.Color; import android.os.Bundle; import android.text.TextUtils;

How to allow user to create and switch between multiple accounts in Flutter?

青春壹個敷衍的年華 提交于 2020-12-06 15:56:36
问题 I am trying to make a Flutter app where the user can sign in into multiple accounts (different email IDs) and can switch between them from the UserAccounsDrawerHeader . For example, in Gmail app, users can switch between multiple Gmail accounts. Is this possible using Firebase Auth for Flutter? 回答1: In the default scenario, Firebase Auth generally does not support allowing a user to be signed in with multiple accounts at the same time. If you want to add support, what you will have to do is