-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
24 lines (22 loc) · 898 Bytes
/
index.php
File metadata and controls
24 lines (22 loc) · 898 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php
require __DIR__ . "/vendor/autoload.php";
$client = new Google\Client();
$client->setClientId("715216700104-9215hic2m4d9eg12c6std8f52ddhpi4a.apps.googleusercontent.com"); //client id generated from google cloud console
$client->setClientSecret("C4EuJ9MIO2q5NEl9gGdw0vEyzriS"); //client secret generated from google cloud console
$client->setRedirectUri("http://localhost/comsci_ia/redirect.php"); //redirect to redirect.php for login
$client->addScope("email");
$client->addScope("profile");
$url = $client->createAuthUrl();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="index.css">
<title>Google Login</title>
</head>
<body>
<a href="<?= htmlspecialchars($url) ?>" class="google-btn"> Sign in with Google </a>
</body>
</html>