Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Authenticating with Google with OAuth 2.0 and Userinfo API, what does it mean for the email to be verified?

I'm getting started using OAuth 2.0 with Google for authentication. I'm using Google's Using OAuth 2.0 for Login document, and everything is working great. I have a question about the verified_email field. It is documented like this:

verified_email : A flag that indicates whether or not Google has been able to verify the email address.

But what does that mean, exactly? Is it considered best practice to make sure the email is verified when authenticating in this way, or is the fact that we've gotten back a response with the correct email proof enough that the user is the owner of said email account?

like image 681
Darshan Rivka Whittle Avatar asked Jun 05 '12 07:06

Darshan Rivka Whittle


People also ask

What is OAuth 2.0 authentication and how it works?

OAuth 2.0, which stands for “Open Authorization”, is a standard designed to allow a website or application to access resources hosted by other web apps on behalf of a user. It replaced OAuth 1.0 in 2012 and is now the de facto industry standard for online authorization.

What is OAuth 2.0 authentication in web API?

Using OAuth 2.0, it is possible for the application to access the user's data without the disclosure of the user's credentials to the application. The API will grant access only when it receives a valid access token from the application.

What is OAuth for email?

OAuth is a standard authorization protocol that provides delegated access to a protected resource using web tokens instead of passwords.


1 Answers

It means different things whether the mail is hosted by google, or not.

-If the user has an email address @gmail.com or @hosted-example.com, where hosted-example.com is a domain using Google apps (and in particular hosted Gmail), then Google accounts also implement access control/login to the email account. In this case, the verified_email bit is always 'true', but in fact the guarantee is stronger than "Google has been able to verify the email address".

  • On the other hand, if the email address is on a non-Google-hosted account, e.g. @yahoo.com, it means that Google was able to validate it (typically by sending the user an email and obtaining confirmation of receipt) at some point in time. The information may not be current: The user may have lost control over that account. So in this case, the information is possibly useful in terms of spam signal, but probably should not be relied upon exclusively for some more critical operation, e.g., account recovery.
like image 92
user1289356 Avatar answered Sep 28 '22 08:09

user1289356