Following the docs to Build Java apps with Microsoft Graph successfully and after that I wanted to add an api to Get user activities the api returns a success message
Nov 22, 2022 5:28:34 PM com.azure.core.util.logging.ClientLogger performDeferredLogging
INFO: Azure Identity => getToken() result for scopes [user.read, mail.read, mail.send, UserActivity.ReadWrite.CreatedByApp]:SUCCESS
then it freezes
for approx. 15-20 minutes then it returns this error
Nov 22, 2022 5:37:38 PM com.microsoft.graph.logger.DefaultLogger logError
SEVERE: CoreHttpProvider[sendRequestInternal] - 409Graph service exception Error code: UnknownError
Nov 22, 2022 5:37:38 PM com.microsoft.graph.logger.DefaultLogger logError
SEVERE: CoreHttpProvider[sendRequestInternal] - 409Error message: {"Message":"Request limit exceeded for Authentication Failure"}
Nov 22, 2022 5:37:38 PM com.microsoft.graph.logger.DefaultLogger logError
SEVERE: CoreHttpProvider[sendRequestInternal] - 409
Nov 22, 2022 5:37:38 PM com.microsoft.graph.logger.DefaultLogger logError
SEVERE: CoreHttpProvider[sendRequestInternal] - 409GET https://graph.microsoft.com/v1.0/me/activities/microsoft.graph.recent?%24orderby=lastModifiedDateTime%20DESC
Nov 22, 2022 5:37:38 PM com.microsoft.graph.logger.DefaultLogger logError
SEVERE: CoreHttpProvider[sendRequestInternal] - 409SdkVersion : graph-java/v5.22.0
Nov 22, 2022 5:37:38 PM com.microsoft.graph.logger.DefaultLogger logError
SEVERE: CoreHttpProvider[sendRequestInternal] - 409
Nov 22, 2022 5:37:38 PM com.microsoft.graph.logger.DefaultLogger logError
SEVERE: CoreHttpProvider[sendRequestInternal] - 409
Nov 22, 2022 5:37:38 PM com.microsoft.graph.logger.DefaultLogger logError
SEVERE: CoreHttpProvider[sendRequestInternal] - 409429 :
Nov 22, 2022 5:37:38 PM com.microsoft.graph.logger.DefaultLogger logError
SEVERE: CoreHttpProvider[sendRequestInternal] - 409[...]
Nov 22, 2022 5:37:38 PM com.microsoft.graph.logger.DefaultLogger logError
SEVERE: CoreHttpProvider[sendRequestInternal] - 409
Nov 22, 2022 5:37:38 PM com.microsoft.graph.logger.DefaultLogger logError
SEVERE: CoreHttpProvider[sendRequestInternal] - 409[Some information was truncated for brevity, enable debug logging for more details]
Nov 22, 2022 5:37:38 PM com.microsoft.graph.logger.DefaultLogger logError
SEVERE: Throwable detail: com.microsoft.graph.http.GraphServiceException: Error code: UnknownError
Error message: {"Message":"Request limit exceeded for Authentication Failure"}
GET https://graph.microsoft.com/v1.0/me/activities/microsoft.graph.recent?%24orderby=lastModifiedDateTime%20DESC
SdkVersion : graph-java/v5.22.0
429 :
[...]
[Some information was truncated for brevity, enable debug logging for more details]
com.microsoft.graph.http.GraphServiceException: Error code: UnknownError
Error message: {"Message":"Request limit exceeded for Authentication Failure"}
GET https://graph.microsoft.com/v1.0/me/activities/microsoft.graph.recent?%24orderby=lastModifiedDateTime%20DESC
SdkVersion : graph-java/v5.22.0
429 :
[...]
[Some information was truncated for brevity, enable debug logging for more details]
com.microsoft.graph.http.GraphServiceException: Error code: UnknownError
Error
message: {"Message":"Request limit exceeded for Authentication Failure"}
GET https://graph.microsoft.com/v1.0/me/activities/microsoft.graph.recent?%24orderby=lastModifiedDateTime%20DESC
SdkVersion : graph-java/v5.22.0
429 :
[...]
[Some information was truncated for brevity, enable debug logging for more details]
at com.microsoft.graph.http.GraphServiceException.createFromResponse(GraphServiceException.java:419)
at com.microsoft.graph.http.GraphServiceException.createFromResponse(GraphServiceException.java:378)
at com.microsoft.graph.http.CoreHttpProvider.handleErrorResponse(CoreHttpProvider.java:514)
at com.microsoft.graph.http.CoreHttpProvider.processResponse(CoreHttpProvider.java:443)
at com.microsoft.graph.http.CoreHttpProvider.sendRequestInternal(CoreHttpProvider.java:409)
at com.microsoft.graph.http.CoreHttpProvider.send(CoreHttpProvider.java:226)
at com.microsoft.graph.http.CoreHttpProvider.send(CoreHttpProvider.java:203)
at com.microsoft.graph.http.BaseCollectionRequest.send(BaseCollectionRequest.java:103)
at com.microsoft.graph.http.BaseFunctionCollectionRequest.get(BaseFunctionCollectionRequest.java:79)
at graphtutorial.Graph.userActivity(Graph.java:134)
at graphtutorial.App.listUserRecentActivities(App.java:211)
at graphtutorial.App.main(App.java:9)
I think the this part Error message: {"Message":"Request limit exceeded for Authentication Failure"} of the error
is why I am getting the it I don't know why it is a authentication failure and yes I have read the docs and have given the permission in the docs.
This delegated permission is added to the app as per the docs UserActivity.ReadWrite.CreatedByApp
and the authorization token is constructed as the docs of the Build Java apps with Microsoft Graph