Hi there
I’ve created a new Social Login Key for Office 365, and also registered a new app on Azure Portal.
When I try to login to my ERPNext instance using Office 365, it allows me to enter my Office 365 username and password, but after this, I get the error “ValidationError: Email not verified with Office_365”.
I can see in oauth.py that it tries to get a “verified_email” or “verified” property from the session info, but doesn’t:
info = session.get(api_endpoint, params=api_endpoint_args).json()
if not (info.get(“verified_email”) or info.get(“verified”)):
frappe.throw(_(“Email not verified with {0}”).format(provider.title()))
Does this mean I need to somehow verify my email on the Office365 side?
I know @revant_one did fantastic work on the Social Login Keys, thank you! Sorry for the ping, but you’ll probably know the answer to this in seconds.
Full error Traceback:
Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/app.py”, line 66, in application
response = frappe.api.handle()
File “/home/frappe/frappe-bench/apps/frappe/frappe/api.py”, line 56, in handle
return frappe.handler.handle()
File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 21, in handle
data = execute_cmd(cmd)
File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 56, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 1027, in call
return fn(*args, **newargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/integrations/oauth2_logins.py”, line 28, in login_via_office365
login_via_oauth2_id_token(“office_365”, code, state, decoder=json.loads)
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/oauth.py”, line 114, in login_via_oauth2_id_token
info = get_info_via_oauth(provider, code, decoder, id_token=True)
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/oauth.py”, line 146, in get_info_via_oauth
frappe.throw(_(“Email not verified with {0}”).format(provider.title()))
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 352, in throw
msgprint(msg, raise_exception=exc, title=title, indicator=‘red’)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 338, in msgprint
_raise_exception()
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 311, in _raise_exception
raise raise_exception(msg)
ValidationError: Email not verified with Office_365