Mahendran P
Mahendran P

Reputation: 1

Azure AD Client Credential refresh the access token

I am developing Daemon (App-Only or Unattended) service to communicate with office 365 using EWS, to do this I have acquired a toke using following code.

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;

I am looking for an option to refresh the access token. I got chance to look at the wiki given by #adal team unfortunately I am confused with the following statement

Note that, AcquireTokenSilent does not need to be called in the Client credentials flow (when the application acquires token without a user, but in its own name)"

Please clarify how to refresh the token obtained by ClientAssertionCertificate.

Thanks Mahendran

Upvotes: 0

Views: 1337

Answers (1)

Tom Sun
Tom Sun

Reputation: 24549

Please clarify how to refresh the token obtained by ClientAssertionCertificate.

Unfortunately, there is no refresh token returned by using clientAssertionCertificate. We could capture the request with fiddler.

enter image description here

Upvotes: 0

Related Questions