Google sign account on Firebase test lab - firebase

I am using Firebase test lab to automate ui test.
Is there any possible way to login my own test account instead of test account ?
It seems that Firebase support custom login but not work for me.
Custom sign-in: If you provide test account credentials, you need to
tell Robo test where to enter them, and also provide those
credentials.
Thanks

If you require a Google account to log in, your only option is to allow Robo to use its own account.
If your app allows some sort of custom username/password login using form fields that you created yourself, then you can arrange for those values to be entered by configuration, as the documentation is saying. This is not going to be a Google account.

Related

Firebase linking Anonymous user to Email Link user?

I would like to create an anonymous user account for visitors to the app to collect some basic info via forms and then prompt them to create an account via Email Link Authentication (no password) later.
I am using the JavaScript SDK and this is the link to the documentation
The goal is to link these two accounts. I am getting an "Unknown provider" error when trying to do this. The docs do not specify whether or not this is possible and there is no example. Is this possible?

Detect whether authetication credientials are already linked or not in Firebase

In Firebase, I want the users to be able to sign in with providers like Facebook, Twitter, and Google but not to sign up with them. So, when the user tries to login with them, how can I detect whether his/her credentials are linked to an account or not before trying to sign in with those credentials to Firebase?!
I don't think this is going to be possible. To be able to link accounts with those providers, you'll need to enable the providers in the Firebase console. And once you do that, users can call the API themselves to create an account with that provider.
If you don't care about this out-of-bounds abuse, and just want to make it work in your application code, have a look at the fetchSignInMethodsForEmail method.

Firebase authentication with multple providers

I'm trying to create a user authentication screen, so I decided to use Firebase.
However, I am facing a problem. Nowadays I have enabled 2 providers, which are:
1- E-mail/Password
2- Google
Enabled providers
I can create users perfectly.
When I create a user with E-mail/password option and use the Gmail address guilherme.nunes#fover.com.br, Firebase creates the user normally.
After using email, I am trying to use the second option of Google provider, using the same email. Now the old user is replaced with the new provider in Firebase.
account created
After this, if I try to login with the first option (E-mail/Password) again, it says that the user does not exist.
I tried disabling the option to have 1 user per account, but then, Firebase creates 2 distinct users.
What I would like, is to link 1 account, with several providers.
Can someone help me, please?
When you enable the option to allow only a single account per email address, Firebase has certain providers that are preferred for certain email domains. Most notably: the Google provider is the preferred provider for #gmail.com addresses.
So in your initial process, you:
Register a user something#gmail.com with a email+password account.
Register a user something#gmail.com with a google account.
In this case, the second registration replaces/overrides the initial account.
What you want to do is link the two accounts/providers as described in the documentation on account linking. With this approach you don't fully register an account in step 2, but instead link the credentials for that second account to the email+password account that was already created for the user.
The documentation has a step-by-step explanation on how to do this. If you're having trouble making this work, post a new question with the minimal, complete/standalone code that reproduces where you got stuck.

How to integrate LINE login into Firebase Auth

I did some research and experiments on integrating LINE login with Firebase Auth using Flutter. I have some questions:
Looks like in Firebase Auth, there are AuthProvider, and in Flutter source code, I also found an OAuthProvider. There you can create Credential to include your idToken and access token. But I don't know how to specify the providerId in that Credential. I guess it is not possible, because Firebase hasn't integrate LINE login. The client side api: logInWithCredential can ONLY work with Firebase supported login methods, and you have to enable them in your Firebase console. Am I right?
So it looks like now I have to setup my own server to exchange LINE access token to Firebase custom token. In my server, I first verify access token and grab the LINE user profile, then I create a custom token, but there I have to decide a UID, which I have to use some pattern like LINE:${LINE_UID}. This looks like some hacking, is there a better way?
Admin API to create custom token only accept UID or optionally a user claim, I have no way to set its display name or some other basic info. So if I directly send the token with UID like LINE:${LINE_UID} to a client, then the client logInWithToken, it will create a user without display name if it doesn't exist. The only workaround I can image is, in the server-side, generate the LINE:${LINE_UID} and look up it in Admin API, if it doesn't exist, then I create a user with a proper display name. This looks again not so good, because the document said if you do logInWithToken, it will create one if it is not there, and we cannot use that because I want to set it's display name when it is created. Any better solution?
I want to link a user with multiple auth provider. I saw in the Firebase JWT, they are well included, that is cool. But those linked elements are user profile get via credential. So can we link a user to a LINE login? Which is not built-in Firebase Auth Provider? Is auth provider linking only valid for Firebase built-in provider?
Regards,
Xiang.
You're asking way too much in a single post, which makes it hard to help. I'll try to address below, but please follow the advice on How do I ask a good question going forward.
The general approach for adding LINE as an authentication provider is shown in this blog post: Authenticate your Firebase users with LINE Login. There is also a example, which shows how to use Cloud Functions as the server component for this. If you get stuck implementing those for Flutter, post the minimal, complete/standalone code that reproduces this issue.
The client side api: logInWithCredential can ONLY work with Firebase supported login methods, and you have to enable them in your Firebase console. Am I right?
Nope, you're wrong. You can also provide your own sign-in provider for Firebase, and use the tokens you mint there with the Firebase Authentication SDK.
This looks like some hacking, is there a better way?
The UID can be whatever you want, but you'll have to ensure it is unique. A common way to ensure global uniqueness is to embed some identifier for the provider in the UID. If you prefer another way to ensure global uniqueness, you're free to use that too of course.
I have no way to set its display name or some other basic info [when creating the account]
This is indeed a common problem with some providers, as you for example can't set the display name for the email+password provider until after the account has been created. With a custom provider you can put whatever information you want in the initial JWT already though.
can we link a user to a LINE login? Which is not built-in Firebase Auth Provider?
See Linking custom auth provider with Firebase
Late to the party .
but This article helps you which I publish on Medium.
I'm using A Flutter plugin LINE's native SDKs in Flutter apps with Dart. The plugin helps you integrate LINE Login features in your app. You can redirect users to LINE or a web page where they log in with their LINE credentials. package
Also, I make a git hub repo for the same.
Did you check out the firebase_auth plugin? It has lots of helpfull features.
https://pub.dev/packages/firebase_auth

firebase admin multi-factor login

excited about Firebase, my admins must use multi-factor login for the account dashboard (policy issue). Is this possible? Is it a setting I can't find? Can I login to account dashboard using Google (and thus force mult-factor)?
Disclaimer: I work for Firebase
Firebase's log in system is separate from Google's and does not offer two-factor auth. We are looking to enhance this, but currently these are constraints.
If you want your application administrators to go through a more stringent log in process than Firebase allows for its account dashboard, you might want to consider setting up an application-administration dashboard. This is just a separate section of your application that you build. So that also means you have full control over the access mechanism, through a custom token generator.

Resources