-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
executable file
·44 lines (42 loc) · 1.75 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width" />
<script type="text/javascript" src="cordova.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script>
<script type="text/javascript" src="cordova.oauth2.js"></script>
<script>
// template for new oauth2 service
function oauth2_login() {
$.oauth2({
auth_url: 'https://accounts.google.com/o/oauth2/auth',
response_type: 'token',
logout_url: 'https://accounts.google.com/logout',
client_id: '187356770002-vd2chjjahaeba35nockphhp85qjodps7.apps.googleusercontent.com',
redirect_uri: 'http://localhost:8383/AjaxWebPage/index.html',
other_params: {scope:'profile'}
}, function(token, response){
makeAPICalls(token);
}, function(error, response){
alert(error);
});
}
</script>
<style>
body{background-color:white;font-family: Arial;margin: 0}
.content {padding: 0 20px}
.button {text-align: center;padding: 10px;border-radius: 10px;border: 1px solid #777;background-color: #ddd}
h1 {text-align: center}
p.success {background-color: #efe; padding:5px}
p.error {background-color: #fee; padding:5px}
</style>
<title>Oauth2 Cordova XDK</title>
</head>
<body>
<div class="content">
<h1>Oauth2</h1>
<p><div class="button" onclick="oauth2_login()">Oauth2 Login</div></p>
<div id="logs"></div>
</div>
</body>
</html>