-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdemo.html
More file actions
125 lines (110 loc) · 5.12 KB
/
demo.html
File metadata and controls
125 lines (110 loc) · 5.12 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
<!doctype html>
<head>
<meta charset="utf-8">
<title>JSO Demo</title>
<!-- All JavaScript at the bottom, except this Modernizr build.
Modernizr enables HTML5 elements & feature detects for optimal performance.
Create your own custom Modernizr build: www.modernizr.com/download/ -->
<script src="resources/js/lib/json2.js" type="text/javascript"></script>
<script src="YOUR-API-KEY"></script>
<script src="resources/js/lib/localstorage.js" type="text/javascript"></script>
<script src="resources/js/lib/modernizr-2.5.3.min.js" type="text/javascript"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js" type="text/javascript"></script>
<script src="resources/js/lib/jso.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
// Add configuration for one or more providers.
jso_configure({
"uwap": {
client_id: "-----",
redirect_uri: "http://localhost/~andreas/jso/demo/",
authorization: "http://proxydemo.app.bridge.uninett.no/_/oauth/auth.php/authorization"
}
,"facebook": {
client_id: "-----",
redirect_uri: "http://localhost/~andreas/jso/demo/",
authorization: "https://www.facebook.com/dialog/oauth",
presenttoken: "qs"
},
"linkedin": {
client_id: "-----",
redirect_uri: "http://localhost/~andreas/jso/demo/",
authorization: "https://www.linkedin.com/oauth"
},
"google": {
client_id: "592724387191-11c780839aqbk2575mrufj6kgi3i0ksl.apps.googleusercontent.com",
redirect_uri: "http://localhost/latitude",
authorization: "https://accounts.google.com/o/oauth2/auth"
},
"ibm": {
client_id: "-----.googleusercontent.com",
redirect_uri: "http://localhost/~andreas/jso/demo/",
authorization: "https://accounts.google.com/o/oauth2/auth"
},
"solberg": {
client_id: "andreas2",
redirect_uri: "file://localhost/Users/andreas/Sites/jso/demo/index.html",
authorization: "http://bridge.uninett.no/solberg-oauth/www/server/server.php/authorization"
},
"solberg2": {
client_id: "andreas",
redirect_uri: "http://localhost/~andreas/jso/demo/",
authorization: "http://bridge.uninett.no/solberg-oauth/www/server/server.php/authorization"
},
"solberg3": {
client_id: "jsodemo",
redirect_uri: "http://localhost/~andreas/jso/demo/",
authorization: "http://proxydemo.app.bridge.uninett.no/_/oauth/auth.php/authorization"
},
"instagram": {
client_id: "xxx",
redirect_uri: "http://localhost/~andreas/jso/demo/",
authorization: "https://instagram.com/oauth/authorize/",
scope: ["basic", "likes"],
isDefault: true
}
});
// if (!confirm('Continue')) return;
// Make sure that you have
/*jso_ensureTokens({
// "facebook": ["read_stream"],
"google": ["https://www.googleapis.com/auth/userinfo.profile"]
//"instagram": ["basic", "likes"]
});
*/
// This dumps all cached tokens to console, for easyer debugging.
jso_dump();
// Perform a data request
/*$.oajax({
url: "https://api.instagram.com/v1/subscriptions",
jso_provider: "instagram", // Will match the config identifier
jso_scopes: false, // List of scopes (OPTIONAL)
dataType: 'json',
success: function(data) {
console.log("Response (bridge):");
console.log(data);
},
error: function() {
console.log("ERROR Custom callback()");
}
});*/
// Perform a data request
$.oajax({
url: "https://www.googleapis.com/oauth2/v1/userinfo",
jso_provider: "google",
jso_allowia: true,
jso_scopes: ["https://www.googleapis.com/auth/userinfo.profile"],
dataType: 'json',
success: function(data) {
console.log("Response (google):");
console.log(data);
}
});
// jso_wipe();
});
</script>
</head>
<body>
<h1>Andreas Solberg JSO Demo</h1>
</body>
</html>