How to get Signed in accounts in RecyclerView - firebase

I have enabled Google Sign in for my app.I want to add the search option where I can search for a particular user. How should I go about with the process?

Related

Can I add google authenticated user to users list in firebase?

I am creating an app in Xamarin using firebase for the login and I would like it for users to sign up with email or google. If I sign them up via email they get added to this list of users:
But when I authenticate them via google then do not get added to this list. Is there a way to enable this?
I would like to later use the uid's in this list to store data per user and that is why I want them all in 1 list.
When a user that signed in with Google, then uses their Google credentials to sign in with Firebase, their profile does show up in the Firebase console with a colored G icon.
For example, here's a list of some users from one of my projects:
The first user is an email+password user, then there are 3 anonymous users, and then there's a user that signed in with their Google account.
If the Google user does not show up for you, make sure you signed them in to Firebase too.

Is the reCAPTCHA v3 admin console free and accessible without having a GSuite account? If so, where?

I don't know where to find the Google traffic results (output) for reCAPTCHA v3 because I don't know where to find the "admin console" where the results would be output (where I could adjust parameters, etc.).
I used my regular email address (not associated with a GSuite account) when I entered the domain name for the site I'm working on and generated the site key and the secret key for the reCAPTCHA code.
I have a second email address (associated with a GSuite account I have and tied to a different email address and a completely different site from the one I'm installing the reCAPTCHA in).
The only Google-related "admin console" I've been able to find so far is the one that goes with the GSuite account (not the one I want associated with the site I'm working on).
Is there somewhere else I can find the right admin console for the reCAPTCHA info? (It seems counterintuitive that Google would claim reCAPTCHA is free and then make a user pay for GSuite to have access to the stats.)
Use of reCAPTCHA is not tied to G Suite.
You can access the reCAPTCHA admin console here:
https://www.google.com/recaptcha/admin/site/
This is also linked from the top-right side of the homepage:
https://www.google.com/recaptcha/intro/v3.html
The specific reCAPTCHA keys will only be visible to accounts that are owners of the site. To add an owner:
sign in to the Google account that has access to the reCAPTCHA key you want to share
go to the settings for the site, accessible via the cog icon on the right side of the admin console
there will be a section heading "Owners"
add the email address of the Google account you want to allow access
click "Save" at the bottom of the page
Sign in to the Google account you added as an owner and you should now see the site in the admin console

Firebase disable automatic login account creation

I am building a web and mobile app using firebase. When signing with Google, firebase auto creates a new account in the project (Auth) if one does not exist. Its fine with the mobile app.
But with the web, I just want existing users (who created accounts with mobile app) to signin and not create new accounts via web.
How do I setup firebase not to create new accounts if one does not exist?
There isn't a way to restrict social sign-in with Firebase Auth to "only sign in, not sign up".
If you have a means of detecting users that have signed in using the app at some point (e.g. by writing a value to your database in a specific location), you could check for that value when signing in via the web, and, if missing, display a screen encouraging users to install the mobile app.
I think this is what you are looking for:
Link Multiple Auth Providers to an Account Using
JavaScript
You can allow users to sign in to your app using multiple
authentication providers by linking auth provider credentials to an
existing user account. Users are identifiable by the same Firebase
user ID regardless of the authentication provider they used to sign
in. For example, a user who signed in with a password can link a
Google account and sign in with either method in the future. Or, an
anonymous user can link a Facebook account and then, later, sign in
with Facebook to continue using your app.

Firebase: Link facebook account with existing user

I have a current database with active users in Firebase that can login with user/pwd but now I'm implementing the facebook login and I realised the only way to link a facebook account with an existing user is only when the user is already logged with the user/pwd but not before the login.
I have two buttons in my app (login with fb and with email) but if I try to login with fb using the same email of an existing user, I will receive the following error auth/account-exists-with-different-credential and the documentation says that in order to fix this the user needs to login first then link.
Do you know if there is a way to link both accounts but without perform a login first, I mean, from the login view?
You need to sign in the user first before linking. This is important if you want to ensure it is the same user. Otherwise you can switch to multiple accounts per email in the Firebase console.
The way to solve this, when you get the error auth/account-exists-with-different-credential, the error will contain error.email and error.credential after you sign in with Facebook and the account already exists as a password account.
You then call firebase.auth().fetchProvidersForEmail(error.email) to which resolves with the list of provider IDs for that email. In this case, it will contain ['password']. You then ask the user to provide their password. You call signInWithEmailAndPassword(error.email, password) to sign-in the original user. You then call firebase.auth().currentUser.linkWithCredential(error.credential) to link the Facebook credential to the password account. Now both accounts are merged and the user can sign in with either.
I fixed it by going to the Firebase console. then head over to the authentication section and select the Settings Tab. Afterwards, go to User account linking and check Create multiple accounts for each identity provider

Firebase : Authentication providers different email address

If I register with Facebook (x#x.com) and later log in with Google (y#y.com), but I do not have the same email address on both providers, there are 2 users created. How can I handle this situation?
Linking is typically used in three cases:
Automatically requested by the backend for security reasons: when a user signs in to google for example with email x#x and then logs out and tries to sign in with a new facebook account x#x. In this case the backend will not complete the second sign in without verifying that the second user is the same as the first user (since both use the same email). So in this case, the user has to sign to the google account and then link the second facebook account to the initial one.
Manually triggered by the developer: One common case here is that the user signs in to google with email x#x and remains signed in. The developer wants access to the user's facebook friends. So the developer will ask the user to link their facebook account to the already logged in google user.
Upgrading an anonymous user: Developer could automatically sign in users initially as anonymous and then prompt them to upgrade to a registered user. In this case you can call link on the anonymous user.
So auth.currentUser.link can be made on all kinds of users as long as the account you are linking is new and not already linked.
You'll want to use the Account Linking APIs to authenticate multiple providers for the same account. Docs for Web, Android, and iOS are available.

Resources