简体   繁体   中英

Checking that an email address is valid as a google account

I'm working on an application where we integration with google docs via the API. We share these documents via the API with various members (email addresses) registered in the system. We'd like to know if a member (email address) has a google account acceptable email address. There seems to be three different ways an email address can be used as a google account:

  1. regular gmail email address (eg, joe@gmail.com)
  2. google apps backed email address (eg, joe@somecompany.com where somecompany.com uses google apps)
  3. use a plain old email address (eg, joe@yahoo.com)

When first developing the solution I was using an MX record lookup on the domain name to see if it was backed by google. This works great for #1 and #2, but doesn't work for #3. We didn't realize that a user can sign up for a google account and just use their "regular" email address. Is there any way that we can determine if an email address is a valid google account email address so that when that user logs into google using that email address they have access to google docs?

从我所看到的,唯一可靠的解决方案是让用户使用OpenID( Google OpenID )从您的网站登录他们的Google帐户。

you can use google's openid for that . see the openid.ax.required parameter. essentially you are asking google to tell you the user's email address. i heard google is nice enough to tell you the user's email address. HOWEVER, note that afaik openid itself doesn't mandate identity provider to tell service provider (you) about this kind of thing. as such, whether google will still tell you the email address in the future, i don;t know.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM