Google Analytics User Management Insert User - google-analytics-api

I am using this endpoint to insert a user onto a Google Analytics account (https://developers.google.com/analytics/devguides/config/mgmt/v3/mgmtReference/management/accountUserLinks/insert)
I am getting back an error (just for this user):
[{"message":"Value for field user.email = NAME#CLIENTDOMAINREDACTED.com is not valid.","domain":"global","reason":"invalidValue"}]
I cannot see this error quoted anywhere else and it works for other email addresses. This one doesn't have whitespace at the beginning or end either.
Is this email banned somewhere? Is there any other reason for this potentially?

I found the reason was that this email address does not seem to be associated with a Google Account.
Which is strange since I also tried to add a random string of letters that is not associated with a Google Account and it let me do that!

Related

Looking for a way to verify email addresses using Swift and Firebase

I'm currently looking for a solution for creating an iOS application using swift and Firebase as an authentication and database storage system. I'm relatively new to swift and Firebase. I currnently have methods in place that validate the input of my text, in the given text fields in a form.
Here is my method used to validate the format of the email. "Utilities" is in reference to a expression that shows the valid format.
let cleanedEmail = emailAddressTextField.text!.trimmingCharacters(in: .whitespacesAndNewlines)
if Utilities.isValidEmail(cleanedEmail) == false {
return "Please enter a valid email address."
I'm looking to now "Verify" an email address in swift and firebase, and find a method or function to verify wether the email address given by a user on signup is real and not just given to support the format of the validation method I have created. This helps me prevent errors on input for users when they sign up.
Just to be clear, if I give a valid email address of "Jack#fmail.com" it will be accepted even if it isn't a real domain. Therefore if a user mistypes their email address it will create an account on a false domain.
If anyone has any suggestions,I'd be happy to hear them.
Thank you.
The most common used option is to send a verification mail to the user. You can activate that functionality in your Firebase console under the Authentication setting. See image and the link for more information on how to set it up in your app.
https://firebase.google.com/docs/auth/ios/email-link-auth

Get all email addresses of user using Google API

For my own gmail account, I have multiple email addresses associated with it. For example, I have an email address from my university that is associated with my gmail, and I can send emails from my gmail as if they are coming from my university email address.
I'm reading up on the Google APIs, and I see that I can get a user's gmail address, but can I also get any other email address that is associated with their gmail account?
When a user logs in to my site, I'd like to present them with a list of the gmail-associated email addresses and let them select the one they would like to use.
EDIT: Thanks everyone for the answers, but I don't think any of them answers the question. I've been playing with Google's OAuth playground. It is strange that I can get lots of very personal information (a list of a user's contacts and even received emails) but I can't get the user's alternative email addresses.
Your description is a little vague. Are you talking about send-as alias accounts or alternate email accounts?
Send-as Alias
Either way, you can interact with the send-as accounts here: Manage Send-as Alias
Alternate Emails via Admin SDK
As for alternate email accounts, they can be accessed via:
Admin SDK: https://developers.google.com/admin-sdk/directory/v1/guides/manage-user-aliases?hl=en
Google Apps Script: https://developers.google.com/apps-script/reference/gmail/gmail-app#getAliases()
Additional info here on how the accounts work.
Email addresses associated with your account
Alternate email addresses and other Google products
Connect other email accounts to your Google Account
Federated Login
Also, I'm not exactly sure how you are trying to incorporate this functionality into your site but another area I recommend checking out is Federated Login for Google Account Users. This might also provide you with the functionality you seek.
Using federated login (also known as federated identity), your website
or application can allow visitors to sign in using their Google user
accounts. Federated login frees users from having to set up separate
login accounts for different websites, and frees you from the task of
implementing login authentication measures.
It has been a while since the question was asked. You can use the Google People API to get a user's primary email address and aliases. Here's the documentation. The scope you need to use is: https://www.googleapis.com/auth/user.addresses.read
This will return all the email addresses for the user and also tell you which is the primary one.
If you use OAuth to have your users sign-in with their Google accounts (with or without G+) the user will be prompted (by Google) to select which of their accounts they wish to authorize your application to use:
https://developers.google.com/accounts/docs/OAuth2Login
So to directly answer your question, I'm not aware of an API to return that list of users - however you shouldn't need to, Google will take care of this before returning to your application.
If your user is already logged in, and you wish to give them the ability to change the Google account they are using, I believe it is possible to prompt them again to select the account they are interested in (search for select_account on the link above).
This is possible. However, this has changed since Google announced the deprecation of their Google+ People API, which a lot of folks used to get all the email addresses for a user. The current most voted answer now goes to a 404.
Google Plus People API Replacement
Google has replaced the Google Plus People API /plus/v1/people/me with https://developers.google.com/people/ and you’ll want to use the https://www.googleapis.com/auth/user.emails.read profile scope as discussed here as a replacement. The schema is different, so you'll need to change your mapping as well.
If your app already used the following scopes from the old /plus/v1/people/me your user will not have to re-consent when you switch to the new API:
email
profile
https://www.googleapis.com/auth/plus.login
https://www.googleapis.com/auth/plus.me
https://www.googleapis.com/auth/plus.profile.agerange.read
https://www.googleapis.com/auth/plus.profile.emails.read
https://www.googleapis.com/auth/plus.profile.language.read

Facebook test users and auth

I have a project where I am using Selenium to test the Facebook auth. I created a Facebook app, created a test user inside this app and created some tests using Facebook login. Until now, it was working. But during the last two weeks something changed in Facebook and my tests are failing. It is due to interface changes in permissions dialog (I am targeting the button by his id). The second problem is that I don't get the email address from Facebook test user but a proxy email which is longer than 75 characters (my db field length is hardcoded in framework I am using).
If I log in as a regular user, it is working correctly and I get this permission box:
But when I log in as the test user I created (via 'switch to' in app's developer roles), I get this box:
I tested it ~2 weeks ago and this was yet working. Today it is changed. So my questions:
How to get back the old permissions box for test users?
How can I get the real email address and not the proxy?
Thanks!
I experienced the same problem with the Auth Dialog. I tried it with some old and new apps with various settings including March/Apr. 2013 Breaking Changes enabled/disabled, but it didn't help.
However, I guess I can help you with the email problem. When you login as a test user and go to account settings page, you will see the test user's primary email addres. By default this should be a really long one like the image I attached.
Facebook Platform returns this primary email address. If you pass the Auth Dialog with your test user account and see the privacy setting page, you will find the default primary email address is shared with the app. You have to provide a new email address for the test user and set the new one as primary email address via account setting page.
Why is the Login Dialog different with a test user?
With your test user, you can see the future of login dialogs. In fact, this isn't "not working" but this is an update which was unveiled on December 2012. Let me quote:
Our Login dialogs have undergone a redesign to make it easier to
understand permissions that apps request. We've simplified
presentation and have also updated our language for greater clarity.
“Basic info” has been renamed to “public profile and friend list,” to
reflect what what is being shared. Apps accessing your public profile
get your name, profile picture, age range, gender, language, country
and other public information.
Source: Providing People Greater Clarity and Control, developers.facebook.com/blog
The reason why you don't meet this update with a regular user, is that Facebook doesn't use to update everyone at the same time. They partially launch updates depending on the country, the type of account or some other parameters I ignore.
Example of a partial update (unified_message FQL table) dedicated to developer accounts:
We are providing early access to this API for registered developer
accounts only until the new messaging system is broadly available. You
should use the message table for production applications at the
current time.
In our case, we now know that test users can access to the update, but it is also said:
We have already launched many of these improvements as part of our
iOS6 integration and are now rolling them out more broadly.
About proxy emails
In fact, proxy emails are a way for any users to keep their real email anonymous. You have to consider proxy emails.
When joining an app, the user can choose between a real email and a proxy email:
Other thing you need to expect are users who didn't validate their account when connecting to your app, a case which is possible as described here and here.
Then, why do test users give back a proxy email? Because test users (being bots and having fake emails) didn't validate their emails.
You see that in at least 3 cases (and finally, test users are a good example), you need to handle these proxy emails. They are incidentally or accidentally met by developers and they can't be neglected. For your case, you can still try to disallow tests users who have a proxy email from accessing your app. But you should accept them and shouldn't force them to share their original e-mail addresses. A better solution is that you validate the test users emails:
Connect to the test user account that gives a proxy email
Add an email address (password needed here),
Go to the email mailbox and click on the validation link,
Set the new email address as primary,
The test user should now give his original email and not a proxy anymore!

Graph API incorrectly returning empty array

I'm trying to run a simple query on the graph api. I just want to pull back the id of a user based on the email address they use to login to facebook.
I am using the following query:
https://graph.facebook.com/search?q=facebook.xxx#xxx.xid.au&type=user&access_token=AAADxxxxT64Q8BADcpCdWBojPXPLbZBsSjzj8LPUPhyYJMGWaRuZAP56wIR4BaiUZAaPZA22Ex2y7bgBQHTxxxxxxxxxxxx
and am getting the following in response (no errors, no data)
{
"data": [
]
}
I know the email address is valid - it is my own. This query had worked fine in the past. Any tips on where I should look to for debugging?
https://graph.facebook.com/search?q=facebook.xxx#xxx.xid.au&type=user
Due to privacy concerns searching by email address has been disabled.
However, if you have a user who has granted you email permissions, you can get their email address, however you are limited as to what you can use that email address for.
EDIT
It was filed as a bug (https://developers.facebook.com/bugs/292220680814266) and now is resolved.
Looks like Facebook has caved in to peer pressure and is now allowing this search to happen again.
I think you have no permission to access user's data.
see https://developers.facebook.com/docs/reference/api/permissions/ for more details

Google Adsense Resubmit Problem Error Email Aready Exist

I'm trying to resubmit my website to Google AdSense and it's giving the following error again and again:
A user with the email you specified
already exists Please select a
different Google Account login to
access this account.
How to resolve this issue?
I have changed my password, recovered it but still not working.
You could try logging in to the account associated with the email address you are trying. It sounds like you're trying to create an account using an email address that you have already used to create a different account.