def get_oauth_keys(provider):
 keys = frappe.conf.get(u'{provider}_login'.format(provider=provider))
 if (not keys):
  social = frappe.get_doc(u'Social Login Keys', u'Social Login Keys')
  keys = {}
  for fieldname in (u'client_id', u'client_secret'):
   value = social.get(u'{provider}_{fieldname}'.format(provider=provider, fieldname=fieldname))
   if (not value):
    keys = {}
    break
   keys[fieldname] = value
  return keys
 else:
  return {u'client_id': keys[u'client_id'], u'client_secret': keys[u'client_secret']}

def get_oauth_keys ( provider ) : keys = frappe . conf . get ( u'{provider}_login' . format ( provider = provider ) ) if ( not keys ) : social = frappe . get_doc ( u'Social Login Keys' , u'Social Login Keys' ) keys = { } for fieldname in ( u'client_id' , u'client_secret' ) : value = social . get ( u'{provider}_{fieldname}' . format ( provider = provider , fieldname = fieldname ) ) if ( not value ) : keys = { } break keys [ fieldname ] = value return keys else : return { u'client_id' : keys [ u'client_id' ] , u'client_secret' : keys [ u'client_secret' ] }
get client_id and client_secret from database or conf .