I have the AccessToken, Refresh Token Available and stored in the database against each user authenticated and authorized. I am using GraphSDK for Java for calling the APIs. To Instantiate a GraphServiceClient object i have to pass IAuthenticationProvider instance. What i want to understand is how do i instantiate this IAuthenticationProvider class so that while making the api call ,if the access token is detected to be expired ,it internally uses refresh token to get a fresh access token like what happens in GoogleCredential class of google oauth library. I am using Google auth library for managing oauth2 authentication. I know there is com.google.api.client.auth.oauth2.Credential Class in the library which does manage this autorefresh but how can i use this class in the GraphSDK. I can also switch to any other library or native API calls if the solution handles autorefresh of access token by using refresh token. Can i Use MSAL4J for my use case? Any help appreciated.
Asked
Active
Viewed 382 times
3
-
Where you ever able to get a solution? – bytor99999 Sep 14 '22 at 16:24
-
1i used custom implementation to identify token expiry and renewal. – zee Sep 27 '22 at 16:24