I'm trying to expose a .php file which will allow external applications to post cards to users timeline (all users).
My problem is that currently I can only access this page form my browser while I'm logged in to my google account.
How can I make this page authenticate on the server side so every external service can simply post the data it needs to publish?
This is the current authentication code which checks if the user is authenticated and if not - redirects him. I want to get the accessToken on the server side somehow...
$client = get_google_api_client();
if (!isset($_SESSION['userid']) || get_credentials($_SESSION['userid']) == null) {
header('Location: ' . $base_url . '/oauth2callback.php');
exit;
} else {
verify_credentials(get_credentials($_SESSION['userid']));
$client->setAccessToken(get_credentials($_SESSION['userid']));
}