How do I add discord as a social login?

I’m trying to set up discord as a social login, but i’m getting a 500
server error. This is my settings:

This is the error:

Traceback (most recent call last):
  File "/home/frappe/frappe-bench/apps/frappe/frappe/app.py", line 68, in application
    response = frappe.api.handle()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/api.py", line 55, in handle
    return frappe.handler.handle()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/handler.py", line 31, in handle
    data = execute_cmd(cmd)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/handler.py", line 67, in execute_cmd
    return frappe.call(method, **frappe.form_dict)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 1172, in call
    return fn(*args, **newargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/integrations/oauth2_logins.py", line 50, in custom
    login_via_oauth2(provider, code, state, decoder=decoder_compat)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/oauth.py", line 110, in login_via_oauth2
    info = get_info_via_oauth(provider, code, decoder)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/oauth.py", line 132, in get_info_via_oauth
    session = flow.get_auth_session(**args)
  File "/home/frappe/frappe-bench/env/lib/python3.7/site-packages/rauth/service.py", line 556, in get_auth_session
    session = self.get_session(self.get_access_token(method, **kwargs))
  File "/home/frappe/frappe-bench/env/lib/python3.7/site-packages/rauth/service.py", line 542, in get_access_token
    access_token, = process_token_request(r, decoder, key)
  File "/home/frappe/frappe-bench/env/lib/python3.7/site-packages/rauth/service.py", line 20, in process_token_request
    data = decoder(r.content)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/integrations/oauth2_logins.py", line 54, in decoder_compat
    return json.loads(bytes(b).decode("utf-8"))
  File "/usr/local/lib/python3.7/json/__init__.py", line 348, in loads
    return _default_decoder.decode(s)
  File "/usr/local/lib/python3.7/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/lib/python3.7/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)

The “API Endpoint” field should point to userinfo endpoint. Try this endpoint /users/@me Discord Developer Portal

Page mentions to use “identify” and “email” scope to get email data

I’m getting the same error:

I’m trying to add interaction url. How did you add the redirect url?

Nvm, i figured it out. I needed to pre-ppend “/api/v9” to all URLs except Redirect URL.

1 Like