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?
File modified: apps/frappe/frappe/utils/data.py
Function modified: orjson_dumps
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)
Orianas
February 10, 2026, 5:00pm
4
Pull request and fixes implemented:
develop ← Orianas:fix/orjson-large-int-and-oauth-email-validation
opened 04:58PM - 10 Feb 26 UTC
## Summary
This PR fixes two small issues discovered during O365 Social Login u… sage:
1. Password strength API serialization error
2. Office 365 OAuth email claim handling
This issue also affects version-16 not sure how far it goes back.
---
## 1) Password strength serialization error
### Problem
`zxcvbn` can produce guess counts that exceed the 64-bit integer range supported by `orjson`. This caused a `TypeError` and a 500 response from the `test_password_strength` endpoint.
### Solution
Clamp the large integer values before serialization so `orjson` can handle them safely.
---
## 2) Office 365 OAuth email validation
### Problem
Email validation only checked the `"email"` claim, but Microsoft Entra ID tokens may instead use `"upn"` or `"unique_name"`. This caused valid Office 365 logins to fail.
### Solution
Use the existing `get_email()` helper, which already supports multiple claim formats.
---
## Testing
### Password strength
1. Call `test_password_strength` with a very strong password
2. Confirm a valid JSON response is returned
### OAuth
1. Log in using Office 365 OAuth
2. Verify email is extracted correctly
4. Confirm login succeeds
I get this same error on a totally fresh install before I even land on the main dashboard, detailed it in that PR .