ERPNext and single sign on (SSO)

hi there!
I found out that looks like it’s possible to link Keycloack and Erpnext via Custom Social Login.
And I tried to connect them together.

But I faced a strange problem and got an error.
I tried it quite a few times with different settings but every time I faced similar error.

x

Traceback (most recent call last):
  File "apps/frappe/frappe/website/serve.py", line 18, in get_response
    response = renderer_instance.render()
  File "apps/frappe/frappe/website/page_renderers/template_page.py", line 84, in render
    html = self.get_html()
  File "apps/frappe/frappe/website/utils.py", line 510, in cache_html_decorator
    html = func(*args, **kwargs)
  File "apps/frappe/frappe/website/page_renderers/template_page.py", line 95, in get_html
    self.update_context()
  File "apps/frappe/frappe/website/page_renderers/template_page.py", line 163, in update_context
    data = self.run_pymodule_method("get_context")
  File "apps/frappe/frappe/website/page_renderers/template_page.py", line 225, in run_pymodule_method
    return method(self.context)
  File "apps/frappe/frappe/www/login.py", line 82, in get_context
    "auth_url": get_oauth2_authorize_url(provider.name, redirect_to),
  File "apps/frappe/frappe/utils/oauth.py", line 63, in get_oauth2_authorize_url
    flow = get_oauth2_flow(provider)
  File "apps/frappe/frappe/utils/oauth.py", line 91, in get_oauth2_flow
    oauth2_providers = get_oauth2_providers()
  File "apps/frappe/frappe/utils/oauth.py", line 42, in get_oauth2_providers
    out[provider.name]["auth_url_data"] = json.loads(provider.auth_url_data)
  File "/usr/local/lib/python3.10/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/usr/local/lib/python3.10/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/lib/python3.10/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Here my social login settings:


Maybe someone has ideas how I can deal with it?

I found different links but didn’t find an answer:

https://frappeframework.com/docs/v14/user/en/guides/integration/social_login_key

PS: I already have experience in linking NextCloud and Keycloak and I thought that it should be similar but I couldn’t.

1 Like