gyselroth / tubee

Data management engine with synchronization support
GNU General Public License v3.0
4 stars 4 forks source link

Long running processes with MicrosoftGraphEndpoint ends in multiple 401 errors #69

Closed raffis closed 4 years ago

raffis commented 4 years ago

Describe the bug

Process log:

message: "Client error: `POST https://graph.microsoft.com/v1.0/users` resulted in a `401 Unauthorized` response:\n{\r\n  \"error\": {\r\n    \"code\": \"InvalidAuthenticationToken\",\r\n    \"message\": \"Access token has expired.\",\r\n    \"innerError (truncated...)\n"
        code: 401

To Reproduce

Sync an endpoint of type MicrosoftGraphEndpoint which takes longer than 3600s. The oauth2 token will be invalid after that time and all further objects fail.

Expected behavior

Renew token if a 401 exception of that type occurs.

Environment