-
Notifications
You must be signed in to change notification settings - Fork 0
Oauth2 authentication
token = 'SOA2nNQvB663vs0igU3H22brWHtUibJT';
This is needed to mitigate server-side attacks, because the app_code might be exposed in the future in Javascript. All requests to oauth2/set_access (from infusionsoft campaigns) and oauth2/get_access (user authentication) will include this parameter.
app_code = 'ROWZkx9yBbV2Qffz1IchbNyMnR4591T4';
Each app has an unique 32-bytes app_code
Please keep the above values in an .env file in the application's root directory.
ouath2_url = https://operationalhub.linuxserv.space/oauth2/get_access';
for authentication
ouath2_url = https://operationalhub.linuxserv.space/oauth2/set_access';
for infusionsoft campaigns
Send an http post to the operational hub via curl:
$post_data = array(
`'token' => <token here>,`
`'app_code' => <app_code here>,`
`'email' => <user's email>,`
`'password' => <user's password>,`
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, <Oauth2 url here>);
curl_setopt($ch, CURLOPT_POST, TRUE);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($post_data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type:application/json'));
$response = curl_exec($ch);
curl_close($ch);
$responseData = json_decode($response, true);
if(isset($responseData['status']) && $responseData['status'] === 'SUCCESS')
{
`// save session`
}
The system is under development phase, any feedback welcome