如何使用刷新令牌在 Excel 加载项中使用 OfficeJS 获取新的访问令牌 [英] How to use refresh token to get new access token in Excel add-in using OfficeJS

查看:63
本文介绍了如何使用刷新令牌在 Excel 加载项中使用 OfficeJS 获取新的访问令牌的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在使用 Office js 助手通过 OAUTH 身份服务器(第 3 方 OAuth 隐式提供程序)实现登录屏幕,并且我们能够成功获取 id 令牌和访问令牌.根据我们的要求,一旦它在指定的时间内过期,我们必须使用刷新令牌来获取新的访问令牌.你能帮我实现这个要求吗.

We are using Office js helpers to achieve login screen with OAUTH identity server(3rd-Party OAuth Implicit Provider) and we were able to get id token and access token successfully. Based on our requirement we have to use refresh token to get new access token once it is expired within specified duration. Can you please help on achieving this requirement.

推荐答案

office-js-helpers 库已弃用.您仍然可以使用它,但 Microsoft 不支持它.对于显示在加载项中使用 OAuth 2.0 隐式流程(这是 office-js-helpers 库使用的)的代码,我们现在将人们指向 Office 插件 Microsoft Graph React.但是,这个堆栈答案表明你不能在隐式流中使用刷新令牌.它提出了一种解决方法.

The office-js-helpers library is deprecated. You can still use it, but Microsoft doesn't support it. For code that shows the use of the OAuth 2.0 Implicit Flow (which is what the office-js-helpers library uses) in an add-in, we now point people to Office Add-in Microsoft Graph React. However, this stack answer indicates that you can't use refresh tokens with the Implicit Flow. It suggests a workaround.

这篇关于如何使用刷新令牌在 Excel 加载项中使用 OfficeJS 获取新的访问令牌的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆