Log in to a Chrome app or extension

耗尽温柔 提交于 2019-12-30 11:12:20

问题


How would I go about creating an auth system requiring a user to log in to a Chrome app or extension via my own service?

A good example is the TweetDeck app, where the user can log in completely within the app with no need to visit an external website.


回答1:


Use the Chrome Identity API to authenticate users: the getAuthToken for users logged into their Google Account and the launchWebAuthFlow for users logged into a non-Google account. If your app uses its own server to authenticate users, you will need to use the latter.

from https://developer.chrome.com/apps/app_identity.

Here's an example of an app that implements the Identity API: https://github.com/GoogleChrome/chrome-app-samples/blob/master/github-auth/index.js



来源:https://stackoverflow.com/questions/23139224/log-in-to-a-chrome-app-or-extension

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