use of com.microsoft.aad.msal4j.IAuthenticationResult in project ambry by linkedin.
the class ADAuthBasedStorageClient method refreshToken.
private void refreshToken() throws MalformedURLException, ExecutionException, InterruptedException {
IAuthenticationResult iAuthenticationResult = getAccessTokenByClientCredentialGrant(azureCloudConfig);
AccessToken accessToken = new AccessToken(iAuthenticationResult.accessToken(), iAuthenticationResult.expiresOnDate().toInstant().atOffset(OffsetDateTime.now().getOffset()));
if (accessTokenRef == null) {
accessTokenRef = new AtomicReference<>(accessToken);
} else {
accessTokenRef.set(accessToken);
}
}
Aggregations