The login works for most part, the username and password is entered at Microsoft portal and is authenticated. But when it is redirected to the Frappe page, i get BrokenPipeError: [Errno 32] Broken pipe with the below traceback,
Tried again with the default Office 365 social login key method. Just realised that i had pasted the Secret ID instead of Secret Value from the Azure portal App to the Client Secret field in Frappe. So now the previous error is gone.
Now the error that shows is still BrokenPipeError with the following traceback,
File “/env/lib/python3.10/site-packages/jwt/api_jwt.py”, line 140, in _validate_claims
self._validate_aud(payload, audience)
File “/env/lib/python3.10/site-packages/jwt/api_jwt.py”, line 189, in _validate_aud
raise InvalidAudienceError(‘Invalid audience’)
I was finally able to resolve this issue by editing the frappe.utils.oauth.get_info_via_oauth.py file at line 145 and adding ‘verify_aud : False’ in the options parameter of jwt.decode
if id_token:
parsed_access = json.loads(session.access_token_response.text)
token = parsed_access["id_token"]
info = jwt.decode(token, flow.client_secret, options={"verify_signature": False, "verify_aud": False})
I’m not sure if this is a good way to rectify the error. Any feedback please?