microsoft / Intune-Resource-Access

Sample code and scripts for interfacing with the Intune Resource Access APIs.
MIT License
55 stars 59 forks source link

Reuse of access token in csr-validation possible? #103

Open wallenborn opened 3 years ago

wallenborn commented 3 years ago

The csr-validation library fetches a new access token for each request:

AuthenticationResult authResult = this.authClient.getAccessTokenFromCredential(this.intuneResourceUrl);

There are even unit tests that verify this method is called every time. But if authResult is a standard access token with an expiry date, shouldn't it be reusable? Implementing this is easy, but of course breaks the tests. Is there a reason the library acquires a new token every time?