简体   繁体   English

查找所有者的Gmail地址

[英]find owner's gmail address

Before coming to the problem, the use case of my extension is to redirect to my web application with the selected content on gmail. 在遇到问题之前,我的扩展程序的用例是使用gmail上选定的内容重定向到我的Web应用程序。 For this, the gmail address of the loaded gmail should match with the email address that is registered for using my web application. 为此,已加载的gmail的gmail地址应与使用我的Web应用程序注册的电子邮件地址匹配。 For example, if i have signup the web app with gmail address - abc@gmail.com and now if i open the gmail with the same gmail address ie abc@gmail.com then the user should be allowed to use extension but if i opened the gmail of xyz@gmail.com then i should not able to use the extension because the opened gmail account's email address does not match with the email registered in web app. 例如,如果我使用gmail地址注册了Web应用程序-abc@gmail.com,现在如果我使用相同的gmail地址(即abc@gmail.com)打开gmail,则应该允许用户使用扩展名,但是如果我打开了那么xyz@gmail.com的gmail,则我应该无法使用该扩展名,因为打开的gmail帐户的电子邮件地址与在网络应用中注册的电子邮件不匹配。

I have created a login in the popup.js for authentication and it works but I have no idea on how to get the owner's email address of that opened gmail so i can match if logged in account has the same email address or not. 我已经在popup.js中创建了一个用于身份验证的登录名,并且它可以工作,但是我不知道如何获取已打开的gmail的所有者的电子邮件地址,因此,如果登录的帐户具有相同的电子邮件地址,我可以进行匹配。 How can i do this so? 我该怎么做? Can anyone guide me on this, please? 有人可以指导我吗?

I'll start by assuming that when you say "email ID" you actually mean "email address" which in turn is the user id for those social media networks 我首先假设,当您说“电子邮件ID”时,您实际上是指“电子邮件地址”,而这又是这些社交媒体网络的用户ID。

is it possible to use the API's of any of these Social Media applications to map the email ID I have to a user in those applications and then to get the user's public information? 是否可以使用任何这些社交媒体应用程序的API来映射我在这些应用程序中向用户提供的电子邮件ID,然后获取用户的公共信息?

Yes and No. In order to request profile information from of these social media networks (let's called them just "providers") your app will need to request it on behave of the actual user. 是和否。为了从这些社交媒体网络(简称为“提供者”)中请求个人资料信息,您的应用需要根据实际用户的行为来请求它。 That is, the user will need to authenticate itself with these providers through your app. 也就是说,用户将需要通过您的应用向这些提供程序进行身份验证。 For this to happen, the user will need to provide a minimum amount of information (email and password) and your app will need to authenticate as well...usually through OAuth or a native API by specifying an already issued "App ID" (or Client ID) and an App Secret. 为此,用户将需要提供最少的信息(电子邮件和密码),并且您的应用也将需要进行身份验证...通常通过OAuth或本机API通过指定已发布的“应用ID”(或客户端ID)和应用秘密。 This is information you should receive by these providers once you have successfully registered your app with them. 成功向这些提供商注册应用程序后,这些提供商应该会收到这些信息。

is anyone aware of any 3rd party products / API's which can help provide this kind of identification? 是否有人知道可以帮助提供此类身份证明的任何第三方产品/ API?

I'm not too sure and this is out of the scope of Stackoverflow...but, do you really need to add another abstraction layer in your project? 我不太确定,这超出了Stackoverflow的范围...但是,您是否真的需要在项目中添加另一个抽象层? Another dependency? 另一个依赖? Consider interacting directly with these providers, you have more benefits 考虑直接与这些提供程序进行交互,您将获得更多好处

So, basically, your app will have to get the user to supply his/her credentials in order to request this information. 因此,基本上,您的应用将必须让用户提供其凭据才能请求此信息。 In the case of OAuth, your app will never see these credentials because the authentication process happens outside your app, all your app will receive is an access token to request the information that is available within the scope of the access token. 对于OAuth,您的应用程序将永远不会看到这些凭据,因为身份验证过程发生在您的应用程序外部,您的应用程序将收到的唯一访问令牌是请求访问令牌范围内可用信息的访问令牌。 By that I mean, you have to request specific permissions. 我的意思是,您必须请求特定的权限。 There's a lot of information available on the developer's site of these providers and I'm sure you'll get around it without any problems, but feel free to ask if something is not clear enough. 这些提供商的开发者网站上有很多可用的信息,我相信您会顺利解决这个问题,但是请随时询问是否还不够清楚。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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