[英]Azure AD using refresh token to access access token using javascript
I am using Azure AD to fetch access token. 我正在使用Azure AD来获取访问令牌。 I am using Javascript and HTML to get user logged in and on successful login I got access token and expire time. 我正在使用Javascript和HTML来使用户登录,成功登录后,我获得了访问令牌和到期时间。 Now I am looking forward to get the renewed access token on completion of expire time, I anybody can provide me a solution in javascript which uses the refresh token to fetch new access token. 现在,我期待在到期时间结束后获得更新的访问令牌,我谁都可以使用javascript提供的解决方案来使用刷新令牌来获取新的访问令牌。
JavaScript apps executing in a browser don't rely on refresh tokens representing sessions. 在浏览器中执行的JavaScript应用程序不依赖于代表会话的刷新令牌。 The session is maintained by the cookie that Azure AD issues upon successful authentication. 会话由Azure AD在成功身份验证后发出的cookie维护。 Applications can leverage that session for renewing access tokens, typically by using a hidden iframe that requests tokens via implicit flow and no UX (enforced via prompt=none parameter). 应用程序可以利用该会话来更新访问令牌,通常是通过使用一个隐式iframe来实现的,该iframe通过隐式流而不是UX(通过hint = none参数强制)来请求令牌。 The Azure AD libraries for SPA apps (ADAL JS and MSAL JS) perform those renewal operations automatically for you, implementing the approach I described earlier. SPA应用程序(ADAL JS和MSAL JS)的Azure AD库自动为您执行这些续订操作,从而实现了我前面介绍的方法。 Please see https://azure.microsoft.com/en-us/resources/samples/?service=active-directory&term=javascript for a collection of samples demonstrating usage of those libraries. 请参阅https://azure.microsoft.com/zh-cn/resources/samples/?service=active-directory&term=javascript ,以获取展示这些库用法的样本集合。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.