Is there a way to get user's email address via API? - bitbucket-api

Is there a way via BitBucket's API to get the user's email address associated with our group?
Under:
https://bitbucket.org/api/1.0/users/foobar
I see their username, display_name, first_name, last_name, etc., but no email address.
In a nutshell, I'm trying to figure out if anyone in our team is NOT using our company's email address.
thanks!

Looks like there's an emails endpoint:
Gets the email addresses associated with the account. This call requires authentication.
In your case that would be:
https://bitbucket.org/api/1.0/users/foobar/emails

Related

How to link a backup email address to a firebase phone authentication?

I'm using a Firebase phone auth as primary authentication. Since the phone is vulnerable, I want to link an email address to it that the user can use to access his account to change his phone number in case he lost his phone or got stolen. I can't find a way how to do it.
I saw a method currentUser.linkWithPhoneNumber(). However, reading its documentation, it says it is only supported on web platforms. Is there any other way to make this possible?
When you authenticate a user with a phone number, the only data that you have inside the FirebaseUser object when the authentication completes, are the UID and the phone number. If you need to add an email address to an existing account, you can request the user to provide an email address. Once you have that, you can update the email address using the FirebaseUser#updateEmail(String email) function. As soon as the account is updated, you can add any functionality related to that email address.
Since you didn't specify a programming language, I linked that function to the Android docs, but certainly, you can do the same thing in the case of any other programming languages.
upon further reading, i found Email Link Authentication that answered everything i've asked.
Linking/re-authentication with email link You can also link this method of authentication to an existing user. For example a user previously authenticated with another provider, such as a phone number, can add this method of sign-in to their existing account.
https://firebase.google.com/docs/auth/flutter/email-link-auth

If you use Google as a sign in provider in Firebase, will there always be an email associated with that user?

For example, obviously if you use email as a provider there will be an email associated, and if you use Twitter that is not the case. I was wondering if you can always get an email address if they log in using Google as the sign in provider. I haven't seen a case without an email but I would like to verify that this is always the case.
Accounts from the Google sign-in provider will indeed always have an email address associated with them.
In fact, as far as I know, the email address for this provider is also always already verified by the provider.
Edit: I just realized that it may be possible to change the scopes that you request, in which case you can exclude the email address from the requested scopes and not get an email address. I've never done this myself, but it's worth a try.

Change email address of user who signed it with Google

When using Firebase Auth, should I allow users to change their email address if they originally authenticated with Google?
How would I then handle this, when the user will not have a password and will not be able to log in with this new email address but will have to use the Sign In With Google option and log in with their original google email address.
You can link multiple authentication providers to one account - see the docs here.
This way, they can choose to sign in any of the linked providers on another device or on the original device (e.g. after they've deleted and re-installed the application).

Find firebase user by a part of the email address?

I have a set of users with email addresses like the following (along with other users):
userA#example.com
userB#example.com
userC#example.com
Is there a way to find all users with an email address ending on #example.com or starting with user?
There is no api in firebase authentication, that will enable you to do that. If you want to find the user per ending of email address #example.com, then you have to connect the firebase authentication to firebase database. Then when you query the data, you can split the string retrieved.

Getting Facebook email/email hash

I'll make it short: is it possible to get the user's facebook email adress (or a hashed email adress), so I can let's say compare his facebook email with his email in my database? I'm trying to get a FacebookUser and then use facebookUser.email_hash but that returns nothing.
a similar question has been asked here.
and, I don't think fb api currently gives away the user email addresses.

Resources