M365 Integration

I tried integrating M365 for login using social login key feature in the V16. got error code 417 and log gave me the error File “/home/username/frappe-bench/apps/frappe/frappe/utils/data.py”, line 2569, in orjson_dumps

value = orjson.dumps(obj, default, option)

TypeError: Integer exceeds 64-bit range - can some one help me for the integration

I’m having a similar problem integrating M365 as well with v16. Most of the time when logging in I don’t get this error and instead get a Unhandled Exception with no error information and nothing logged. Is anyone successfully working on v16 with m365?

  1. File modified: apps/frappe/frappe/utils/data.py
  2. Function modified: orjson_dumps
  3. The Fix: You wrapped the orjson.dumps call in a try...except block.

def orjson_dumps(obj, default=None, option=None):
try:

Try the fast way first

return orjson.dumps(obj, default=default, option=option).decode()
except (TypeError, OverflowError):

Fallback to standard json for large integers or complex objects

import json
return json.dumps(obj, default=default, sort_keys=True)

Pull request and fixes implemented: