简体   繁体   English

登录Chrome应用或扩展程序

[英]Log in to a Chrome app or extension

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? 如何创建要求用户通过我自己的服务登录Chrome应用或扩展程序的身份验证系统?

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. TweetDeck应用程序就是一个很好的例子,用户可以在该应用程序中完全登录,而无需访问外部网站。

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. 使用Chrome Identity API验证用户身份:登录到其Google帐户的用户为getAuthToken,登录到非Google帐户的用户为launchWebAuthFlow。 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 . 来自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 这是实现身份API的应用示例: https : //github.com/GoogleChrome/chrome-app-samples/blob/master/github-auth/index.js

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

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