Azure AD客户端凭据刷新访问令牌

时间:2018-09-17 14:09:39

标签: adal

我正在开发Daemon(仅适用于应用程序或无人参与)服务,以使用EWS与Office 365通信,为此,我已经使用以下代码获取了代币。

X509Certificate2 cert = new X509Certificate2(pfxCertificateFilePath, pfxPassword, X509KeyStorageFlags.MachineKeySet);
ClientAssertionCertificate cac = new ClientAssertionCertificate(clientId, cert);
AuthenticationContext authenticationContext = new 
AuthenticationContext(authApiUri);
AuthenticationResult authenticationResult = await authenticationContext.AcquireTokenAsync(resourceServerName, cac);
authenticationResult.AccessToken;

我正在寻找刷新访问令牌的选项。 很幸运,我有机会看到#adal团队给出的wiki,我对以下声明感到困惑

  

请注意,不需要在客户端凭据流中调用AcquireTokenSilent(当应用程序在没有用户的情况下以其自己的名称获取令牌时)”

请说明如何刷新ClientAssertionCertificate获得的令牌。

谢谢 马亨德兰

1 个答案:

答案 0 :(得分:0)

  

请阐明如何刷新ClientAssertionCertificate获得的令牌。

不幸的是,使用clientAssertionCertificate返回的没有刷新令牌。我们可以用提琴手捕捉请求。

enter image description here

相关问题