在下面的链接中建议使用Google Auth Lib
,但github
提供的链接不引用任何 javascript 库:
据我所知,我不能使用它,Code FLow
因为它需要重定向 URL。我应该怎么Access Token
进去Google
?Microsoft Word Add-In
在下面的链接中建议使用Google Auth Lib
,但github
提供的链接不引用任何 javascript 库:
据我所知,我不能使用它,Code FLow
因为它需要重定向 URL。我应该怎么Access Token
进去Google
?Microsoft Word Add-In
为了使用 , 等登录Google
,Facebook
您可以使用office-js-helpers
:
使用安装它npm
:
npm install --save @microsoft/office-js-helpers
在您的代码中,在Office.initialize
:
Office.initialize = function (reason) {
//...
// This to inform the Authenticator to automatically close the authentication dialog once the authentication is complete.
if (OfficeHelpers.Authenticator.isAuthDialog()) return;
// register Google endpoint using
authenticator.endpoints.registerGoogleAuth('GOOGLE-CLIENT-ID');
authenticator
.authenticate(OfficeHelpers.DefaultEndpoints.Google)
.then(function (token) { console.log('_GOOGLE_TOKEN: ', token); })
.catch(OfficeHelpers.Utilities.log);
}
而已!