Get access to multiple gmail accounts in a chrome extension

时光怂恿深爱的人放手 提交于 2019-12-11 12:59:54

问题


I'm creating a Chrome extension that modifies the gmail UI. But when I authenticate (with chrome.identity.getAuthToken) in the Chrome extension, it defaults to using the user account that is signed into Chrome.

But I need data for a gmail account when I am on that gmail page.

I saw this answer, but I was wondering if there was any easier way?


回答1:


I just went through the same process and I couldn't find an easier way.

You'll need to authenticate yourself.

We tried using the mechanism in that link but it requires putting the Client Secret in the Extension - very ugly.

In the end we request and refresh tokens externally through a hosted web page from our www site.

Although a hassle to set up once in place it works nicely and is worth the effort.



来源:https://stackoverflow.com/questions/39136097/get-access-to-multiple-gmail-accounts-in-a-chrome-extension

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!