I’ve configured our keycloak server as a social login key and it seems to work ok until I get redirected back to erpnext after the user has been verified. ERPnext spits out this error:
Traceback (most recent call last):
File "/home/erpadmin/frappe-bench/apps/frappe/frappe/app.py", line 64, in application
response = frappe.api.handle()
File "/home/erpadmin/frappe-bench/apps/frappe/frappe/api.py", line 59, in handle
return frappe.handler.handle()
File "/home/erpadmin/frappe-bench/apps/frappe/frappe/handler.py", line 24, in handle
data = execute_cmd(cmd)
File "/home/erpadmin/frappe-bench/apps/frappe/frappe/handler.py", line 63, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File "/home/erpadmin/frappe-bench/apps/frappe/frappe/__init__.py", line 1055, in call
return fn(*args, **newargs)
File "/home/erpadmin/frappe-bench/apps/frappe/frappe/integrations/oauth2_logins.py", line 50, in custom
login_via_oauth2(provider, code, state, decoder=decoder_compat)
File "/home/erpadmin/frappe-bench/apps/frappe/frappe/utils/oauth.py", line 112, in login_via_oauth2
info = get_info_via_oauth(provider, code, decoder)
File "/home/erpadmin/frappe-bench/apps/frappe/frappe/utils/oauth.py", line 145, in get_info_via_oauth
info = session.get(api_endpoint, params=api_endpoint_args).json()
File "/home/erpadmin/frappe-bench/env/lib/python3.6/site-packages/requests/models.py", line 897, in json
return complexjson.loads(self.text, **kwargs)
File "/usr/lib/python3.6/json/__init__.py", line 354, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.6/json/decoder.py", line 339, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.6/json/decoder.py", line 357, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
The parameters that get passed back to http://erp.mydomain.org/api/method/frappe.integrations.oauth2_logins.custom/keycloak_sso are:
state
session_state
code
How do I even go about debugging this? Any direction would help. I am using Keycloak v11.0 and ERPNext v12.11.2 on Ubuntu 18.04.
Thanks,
S