socialNetworkLogin
This API endpoint represents Step 2 of the OAuth2 authentication flow. Once the user successfully authenticates on the social platform (like Google), the platform redirects them back to your application with a temporary authorization code. Your frontend captures that code and sends this request to your backend to finalize the login and establish a user session.
Documentation
Try it now
Request parameters:
Call example:
socialNetworkLogin({
code: 'bTNWWkpnTE5uV2FBX2kxcDlob1FDTWFmb0hlQlZFZ3VUaVFlS2phTmZaLUh5OjE3OTMyODA3Mzk0MTQ6MToxOmFjOjE',
redirect_url: 'https://sso-twitter.betchain-stage.betcoapps.com/',
social_network_type: '',
social_network_type_id: 3,
state: '8dfbd5b6051046dfa620c1c7d7df8655'
})Response examples:
{
code: 0,
rid: 1753217755,
data: {
result: 0,
result_text: null,
details: {
user_id: 344454,
auth_token: 'as245421ve2456',
jwe_token: 'as2454343421ve2456',
deposit_count: 0,
deposit_amount: 0,
withdrawal_amount: 0,
authentication_status: 0,
is_new_client: false,
qr_code_origin: null,
needs_subscriptions_update: false
}
}
}