Long story short... here it is:
<?php
echo
"<script type='text/javascript'>
$(document).ready(function() {
$('#submit').trigger('click');
});
</script>";
?>
<?php
echo
"<script type='text/javascript'>
$(document).ready(function() {
$('#submit').trigger('click');
});
</script>";
?>
<?php
require_once 'google-api-php-client/src/apiClient.php';
require_once 'google-api-php-client/src/contrib/apiPlusService.php';
//start sessionsession_start();
$client = new apiClient();
$client->setApplicationName("Memory");
//Visit https://code.google.com/apis/console to generate your$client->setClientId('yourClientID');
$client->setClientSecret('yourClientSecret');
$client->setRedirectUri('youRedirectUri');
$client->setDeveloperKey('...');
$client->setScopes(array('https://www.googleapis.com/auth/plus.me'));
//init the required service Books, Buzz, Customsearch, Tasks, etc. - I am using Plus$plus = new apiPlusService($client);if (isset($_GET['code'])) {
$client->authenticate();
$_SESSION['access_token'] = $client->getAccessToken();
header('Location: http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']);
}
//acquire the access tokenif (isset($_SESSION['access_token'])) {
$client->setAccessToken($_SESSION['access_token']);
}
//if the user has granted access before, get the access tokenif ($client->getAccessToken()) {
$me = $plus->people->get('me');
$_SESSION['access_token'] = $client->getAccessToken();
} else {
$authUrl = $client->createAuthUrl();
}
//provide a way to revoke the token since there is no authorization manager on Google+ yetif (isset($_REQUEST['logout'])) {
unset($_SESSION['access_token']);
}
?>
<!doctype html>
<html>
<head></head>
<body>
<header><h1>Google+ Test</h1></header>
<div>
<?php if(isset($me)): ?>
<div>
<href="<?php echo $me['url'] ?>">
<?php print $me['displayName'] ?></a>
<div><img src="<?php echo $me['image']['url'];?>" /></div>
</div>
<?php endif ?>
<?php
if(isset($authUrl)) {
print "<a href='$authUrl'>Login!</a>";
} else {
print "<a href='?logout'>Logout</a>";
}
?>
</div>
</body>
</html>
Subject does not start with '/'. problems making Certificate Request.openssl req -x509 -nodes -days 365 -newkey rsa:1024 -sha1 -subj '/C=RO/ST=youState/L=youCity/CN=www.youpage.ro' -keyout myrsakey.pem -out /tmp/myrsacert.pemopenssl req -x509 -nodes -days 365 -newkey rsa:1024 -sha1 -in D:/temp/myrsacert.pem and then follow the dialog and correctly fill what i thought are the important requests:Organization Name (eg, company) [Internet Widgits Pty Ltd]:www.youpage.ro
Email Address []:cgarbacea@gmail.com<div id="background-wrap">
<img alt="youpage" src="http://fullpathtoimage.jpg" />
</div>
#background-wrap img {
min-width: 950px;
position: absolute;
width: 100%;
z-index: -1;
opacity: 1;
}