I can authenticate with service account through UiPath to read emails but cannot do the same in Python

Hello,

I can authenticate with service account through UiPath to read emails but cannot do the same in Python where I get an 400 error. Does anybody have an idea why is that and how can I fix the issue? I am using the same userEmail and json file in both cases but in UiPath it works and Python it doesnt.

Thank you!